Add test for LtsTimelineClassic Range.h
- Added test_range.cpp with 3 tests for Range struct - Tests cover default constructor, parameterized constructor, and copy constructor Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 file changed
+39
@@ -0,0 +1,39 @@
|
||||
#include "Lts/Common/LtsTimelineClassic/Range.h"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace LtsTimelineClassic
|
||||
{
|
||||
|
||||
class RangeTest : public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
void SetUp() override {}
|
||||
|
||||
void TearDown() override {}
|
||||
};
|
||||
|
||||
TEST(RangeTest, DefaultConstructorInitializesToZero)
|
||||
{
|
||||
Range range;
|
||||
EXPECT_EQ(range.start, 0);
|
||||
EXPECT_EQ(range.end, 0);
|
||||
}
|
||||
|
||||
TEST(RangeTest, ParameterizedConstructorSetsValues)
|
||||
{
|
||||
Range range(100, 500);
|
||||
EXPECT_EQ(range.start, 100);
|
||||
EXPECT_EQ(range.end, 500);
|
||||
}
|
||||
|
||||
TEST(RangeTest, CopyConstructorWorks)
|
||||
{
|
||||
Range range1(100, 500);
|
||||
Range range2(range1);
|
||||
|
||||
EXPECT_EQ(range2.start, 100);
|
||||
EXPECT_EQ(range2.end, 500);
|
||||
}
|
||||
|
||||
} // namespace LtsTimelineClassic
|
||||
Reference in new issue
Block a user