Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lldb/unittests/DAP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ add_lldb_unittest(DAPTests
DAPTest.cpp
FifoFilesTest.cpp
Handler/DisconnectTest.cpp
Handler/ContinueTest.cpp
JSONUtilsTest.cpp
LLDBUtilsTest.cpp
ProtocolTypesTest.cpp
Expand Down
45 changes: 45 additions & 0 deletions lldb/unittests/DAP/Handler/ContinueTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,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"));
}
Loading