Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion lldb/source/API/SBLineEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void SBLineEntry::SetLine(uint32_t line) {
void SBLineEntry::SetColumn(uint32_t column) {
LLDB_INSTRUMENT_VA(this, column);

ref().line = column;
ref().column = column;
}

bool SBLineEntry::operator==(const SBLineEntry &rhs) const {
Expand Down
1 change: 1 addition & 0 deletions lldb/unittests/API/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
add_lldb_unittest(APITests
SBCommandInterpreterTest.cpp
SBLineEntryTest.cpp

LINK_LIBS
liblldb
Expand Down
26 changes: 26 additions & 0 deletions lldb/unittests/API/SBLineEntryTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//===-- SBLineEntryTest.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 "gtest/gtest.h"

#include "lldb/API/LLDB.h"

TEST(SBLineEntryTest, SetLineAndColumn) {
constexpr uint32_t expected_line_no = 40;
constexpr uint32_t expected_column_no = 20;

lldb::SBLineEntry line_entry{};
line_entry.SetLine(expected_line_no);
line_entry.SetColumn(expected_column_no);

const uint32_t line_no = line_entry.GetLine();
const uint32_t column_no = line_entry.GetColumn();

EXPECT_EQ(line_no, line_no);
EXPECT_EQ(column_no, expected_column_no);
}