geom/segment: extract point distance unit test

This commit is contained in:
Danny Robson 2019-03-21 16:26:00 +11:00
parent 426a3a3fde
commit 48b04765d7

View File

@ -2,11 +2,10 @@
#include "geom/segment.hpp"
int
main (int, char**)
{
cruft::TAP::logger tap;
///////////////////////////////////////////////////////////////////////////////
void test_point_distance (cruft::TAP::logger &tap)
{
static struct {
cruft::point3f a, b;
cruft::point3f q;
@ -23,6 +22,14 @@ main (int, char**)
auto d = distance (s, t.q);
tap.expect_eq (d, t.distance, "%!", t.message);
}
}
///////////////////////////////////////////////////////////////////////////////
int
main (int, char**)
{
cruft::TAP::logger tap;
test_point_distance (tap);
return tap.status ();
}