Skip to content
Snippets Groups Projects
Commit 377290f0 authored by Brandon Lai-Cheong's avatar Brandon Lai-Cheong
Browse files

refactor into include folder

parent af282f4d
No related branches found
No related tags found
No related merge requests found
#include <gtest/gtest.h>
#include <triangle.h>
TEST(PointInTriangleTests, PointInTriangle) {
Triangle t = Triangle({1, 0.5}, {3, 0.2}, {2, 1}, 0);
EXPECT_TRUE(t.pointInTriangle({1.96, 0.467}));
EXPECT_FALSE(t.pointInTriangle({1.107,0.834}));
EXPECT_FALSE(t.pointInTriangle({2.553, 0.823}));
EXPECT_FALSE(t.pointInTriangle({1.63, 0.13}));
}
\ No newline at end of file
#include "gtest/gtest.h"
#include "../../src/shapes/triangle.h"
#include "../../src/intersections/intersections.h"
#include <gtest/gtest.h>
#include <triangle.h>
#include <intersections.h>
TEST (TriangleIntersectionTests, TriangleIntersection) {
auto t1 = Triangle(Point(0,0), Point(2,3), Point(5,0), 0);
auto t2 = Triangle(Point(3,1), Point(4,3), Point(6,1), 0);
auto t1 = Triangle(Point{0,0}, Point{2,3}, Point{5,0}, 0);
auto t2 = Triangle(Point{3,1}, Point{4,3}, Point{6,1}, 0);
std::vector<Point> results = intersections(t1, t2);
......
#include "gtest/gtest.h"
#include <shapes/point.h>
TEST(TriangulationTests, Page3Example) {
std::vector<Point> polygon = {
{3,48}, {52, 8}, {99,50}, {138,25},
{175, 77}, {131, 72}, {111, 113},
{72, 43}, {26, 55}, {29, 100}};
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment