General Purpose library for Freestanding C++ and POSIX systems
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

47 lines
831 B

#include "test_scaffold.h"
#include "gp/math.hpp"
#include "gp/rendering/renderer.hpp"
#include <cmath>
struct sin_test : public test_scaffold {
sin_test() {
name = __FILE__ ":1";
}
virtual int run() {
int res = 0;
for(float i = 0; i < 100; i += 0.1) {
float v = gp::sin(i);
float ref = sin(i);
res += 0.3 < gp::abs<float>(ref - v)*100.0/(gp::abs(ref+0.00000001));
}
for(float i = 0; i < 100; i += 0.1) {
float v = gp::cos(i);
float ref = cos(i);
res += 0.3 < gp::abs<float>(ref - v)*100.0/(gp::abs(ref+0.00000001));
}
return res;
}
};
append_test dummy_mldffh6f(new sin_test{});
struct render_test : public test_scaffold {
render_test() {
name = __FILE__ ":2";
}
virtual int run() {
int res = 0;
renderer a;
return res;
}
};
append_test dummy_ml8576f(new render_test{});