Skip to content

Commit fa4a3ce

Browse files
committed
[lldb] add unittest for SBLineEntry
1 parent 02c34e8 commit fa4a3ce

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

lldb/unittests/API/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
add_lldb_unittest(APITests
22
SBCommandInterpreterTest.cpp
3+
SBLineEntryTest.cpp
34

45
LINK_LIBS
56
liblldb
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//===-- SBLineEntryTest.cpp -------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===/
8+
9+
#include "gtest/gtest.h"
10+
11+
#include "lldb/API/LLDB.h"
12+
13+
TEST(SBLineEntryTest, SetLineAndColumn) {
14+
constexpr uint32_t expected_line_no = 40;
15+
constexpr uint32_t expected_column_no = 20;
16+
17+
lldb::SBLineEntry line_entry{};
18+
line_entry.SetLine(expected_line_no);
19+
line_entry.SetColumn(expected_column_no);
20+
21+
const uint32_t line_no = line_entry.GetLine();
22+
const uint32_t column_no = line_entry.GetColumn();
23+
24+
EXPECT_EQ(line_no, line_no);
25+
EXPECT_EQ(column_no, expected_column_no);
26+
}

0 commit comments

Comments
 (0)