- 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>
39 lines
679 B
C++
39 lines
679 B
C++
#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
|