From 278ad311297aff78cd3531660d53be7a2d679230 Mon Sep 17 00:00:00 2001 From: Brandon Lai-Cheong <brandon.lai-cheong@uwaterloo.ca> Date: Wed, 20 Nov 2024 21:01:19 -0500 Subject: [PATCH] init randomized tests --- tests/randomized_union_tests.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/randomized_union_tests.cpp diff --git a/tests/randomized_union_tests.cpp b/tests/randomized_union_tests.cpp new file mode 100644 index 0000000..e901e6f --- /dev/null +++ b/tests/randomized_union_tests.cpp @@ -0,0 +1,28 @@ +#include <gtest/gtest.h> +#include <triangle.h> +#include <union.h> + +class RandomizedUnionTests { + public testing::TestWithParam<> +}; + +float triangleArea() { + +} + +TEST_P(RandomizedUnionTests, RandomTest) +{ + + Triangle top = Triangle({0, 5}, {3, 2}, {5, 3}, 1, 1); + Triangle bottom = Triangle({0.1, 9}, {2, 4}, {5,5}, 2, 2); + + auto results = unionize(bottom, top); + + std::vector<Triangle> expected_results_1 = { + Triangle({0.1, 9}, {1.91038, 4.23585}, {5,5}, 2, 2), + Triangle({1.91038,4.23585}, {2.27273,4.09091}, {5, 5}, 2, 2), + Triangle({0,5}, {3,2}, {5,3}, 1, 1) + }; + + EXPECT_EQ(results, expected_results_1); +} \ No newline at end of file -- GitLab