Add test for LtsTimelineClassic LineMap.h

- Add test_linemap.cpp with 3 tests
- Test empty creation, insert/retrieve, contains
- Follow policy naming convention

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-08-19 15:13:24 +02:00
1 parent 4de8d75015
commit 38239bcebc
1 file changed
+39
@@ -0,0 +1,39 @@
#include "Lts/Common/LtsTimelineClassic/LineMap.h"
#include <gtest/gtest.h>
namespace LtsTimelineClassic
{
class LineMapTest : public ::testing::Test
{
protected:
void SetUp() override {}
void TearDown() override {}
};
TEST(LineMapTest, CreateEmptyLineMap)
{
LineMap lineMap;
EXPECT_TRUE(lineMap.isEmpty());
}
TEST(LineMapTest, InsertAndRetrieveValue)
{
LineMap lineMap;
lineMap.insert(1, 1000);
EXPECT_EQ(lineMap.value(1), 1000);
}
TEST(LineMapTest, ContainsKeyAfterInsert)
{
LineMap lineMap;
lineMap.insert(5, 5000);
EXPECT_TRUE(lineMap.contains(5));
EXPECT_FALSE(lineMap.contains(3));
}
} // namespace LtsTimelineClassic