aboutsummaryrefslogtreecommitdiff
path: root/lldb/unittests/DAP/Handler/ContinueTest.cpp
blob: a67a1a25492c3cc780ca79c57dfeb393bdc2c3f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//===-- ContinueTest.cpp --------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "DAP.h"
#include "Handler/RequestHandler.h"
#include "Protocol/ProtocolRequests.h"
#include "TestBase.h"
#include "llvm/Testing/Support/Error.h"
#include "gtest/gtest.h"

using namespace llvm;
using namespace lldb;
using namespace lldb_dap;
using namespace lldb_dap_tests;
using namespace lldb_dap::protocol;

class ContinueRequestHandlerTest : public DAPTestBase {};

TEST_F(ContinueRequestHandlerTest, NotStopped) {
  SBTarget target;
  dap->debugger.SetSelectedTarget(target);

  ContinueRequestHandler handler(*dap);

  ContinueArguments args_all_threads;
  args_all_threads.singleThread = false;
  args_all_threads.threadId = 0;

  auto result_all_threads = handler.Run(args_all_threads);
  EXPECT_THAT_EXPECTED(result_all_threads,
                       llvm::FailedWithMessage("not stopped"));

  ContinueArguments args_single_thread;
  args_single_thread.singleThread = true;
  args_single_thread.threadId = 1234;

  auto result_single_thread = handler.Run(args_single_thread);
  EXPECT_THAT_EXPECTED(result_single_thread,
                       llvm::FailedWithMessage("not stopped"));
}