init commit

This commit is contained in:
2025-12-23 11:06:30 -10:00
commit 32f10f1ccb
11 changed files with 143 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
add_executable(unittest
${CMAKE_CURRENT_LIST_DIR}/TestShape.cpp
)
message("${CMAKE_CURRENT_LIST_DIR}/TestShape.cpp")
target_link_libraries(unittest PUBLIC
Shapes
gtest_main
)
include(GoogleTest)
gtest_discover_tests(unittest)
+16
View File
@@ -0,0 +1,16 @@
#include <gtest/gtest.hpp>
#include "Rectangle.hpp"
#include "Triangle.hpp"
TEST(TestRectangle, area)
{
const Rectangle r{5.0};
EXPECT_DOUBLE_EQ(r.getArea(), 25.0);
}
TEST(TestTriangle, area)
{
const Triangle t{10.0};
EXPECT_DOUBLE_EQ(t.getArea(), 50.0);
}