feat(ex03): it works
This commit is contained in:
parent
6f17e2e888
commit
b4f48cdfb0
8 changed files with 322 additions and 0 deletions
17
ex03/main.cpp
Normal file
17
ex03/main.cpp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#include "Point.hpp"
|
||||
|
||||
static void assert_bsp(Point a, Point b, Point c, Point p, bool expected) {
|
||||
bool result = bsp(a, b, c, p);
|
||||
std::cout << "a: " << a << "\tb: " << b << "\tc: " << c << "\tp: " << p;
|
||||
std::cout << "\tresult: " << result << " expected: " << expected << std::endl;
|
||||
if (result != expected)
|
||||
throw 0;
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
assert_bsp(Point(0, 0), Point(20, 0), Point(10, 30), Point(10, 15), true);
|
||||
assert_bsp(Point(0, 0), Point(0, 0), Point(0, 0), Point(0, 0), false);
|
||||
assert_bsp(Point(0, 0), Point(20, 0), Point(30, 0), Point(15, 0), false);
|
||||
assert_bsp(Point(0, 0), Point(20, 0), Point(30, 10), Point(15, 10.1f), false);
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue