Area: - Unit test: test inversion of points. - Add reorder_coordinates(). - Remove all set_{x,y,z}_{min,max}() accessors. - Remove set_p_min() and set_p_max(). - Add set_coordinates(). - The constructor now takes 2 Point3D instead of 6 float coordinates. Point3D: - Unit test: finish to test distances, test new cast operator. - Add a cast to string operator. Unit tests: - Add valuetraits.hh with class to display correctly a Point3D in a wrong assertion.
32 lines
433 B
C++
32 lines
433 B
C++
#include <cxxtest/ValueTraits.h>
|
|
|
|
#include <cstdio>
|
|
#include <string>
|
|
|
|
#include "point3d.hh"
|
|
|
|
namespace CxxTest
|
|
{
|
|
|
|
CXXTEST_TEMPLATE_INSTANTIATION
|
|
|
|
class ValueTraits<Point3D>
|
|
{
|
|
private:
|
|
char text_value[50] ;
|
|
|
|
public:
|
|
ValueTraits(const Point3D &source)
|
|
{
|
|
sprintf(text_value, "Point3D%s",
|
|
static_cast<std::string>(source).c_str()) ;
|
|
}
|
|
|
|
const char* asString(void) const
|
|
{
|
|
return text_value ;
|
|
}
|
|
} ;
|
|
|
|
} ;
|