[Lldb-commits] [lldb] Add a unit test for SBBreakpoint::SetCallback (PR #96001)

Chelsea Cassanova via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 18 16:21:36 PDT 2024


================
@@ -0,0 +1,89 @@
+//===-- TestBreakpointSetCallback.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 "Plugins/Platform/MacOSX/PlatformMacOSX.h"
+#include "Plugins/Platform/MacOSX/PlatformRemoteMacOSX.h"
+#include "TestingSupport/SubsystemRAII.h"
+#include "TestingSupport/TestUtilities.h"
+#include "lldb/Breakpoint/StoppointCallbackContext.h"
+#include "lldb/Core/Debugger.h"
+#include "lldb/Core/Progress.h"
+#include "lldb/Host/FileSystem.h"
+#include "lldb/Host/HostInfo.h"
+#include "lldb/Target/ExecutionContext.h"
+#include "lldb/lldb-private-enumerations.h"
+#include "lldb/lldb-types.h"
+#include "gtest/gtest.h"
+#include <iostream>
+#include <memory>
+#include <mutex>
+
+using namespace lldb_private;
+using namespace lldb;
+
+class BreakpointSetCallbackTest : public ::testing::Test {
+public:
+  static void CheckCallbackArgs(void *baton, StoppointCallbackContext *context,
+                                lldb::user_id_t break_id,
+                                lldb::user_id_t break_loc_id,
+                                lldb::user_id_t expected_breakpoint_id,
+                                lldb::user_id_t expected_breakpoint_loc_id) {
+    EXPECT_TRUE(baton);
+    EXPECT_TRUE(context);
----------------
chelcassanova wrote:

An `EXPECT_EQ` for `baton` being `"hello"` right? I'll add that. Also, should I check anything more for the `StoppointCallbackContext` being true here?

https://github.com/llvm/llvm-project/pull/96001


More information about the lldb-commits mailing list