Add timing to fixed unit tests
This commit is contained in:
parent
924ea41518
commit
3c5cff206a
@ -24,7 +24,10 @@ public:
|
||||
}
|
||||
|
||||
static bool construction() {
|
||||
return fixed(7).raw() == 7 * 64;
|
||||
start_timer();
|
||||
bool r = fixed(7).raw() == 7 * 64;
|
||||
end_timer();
|
||||
return r;
|
||||
}
|
||||
|
||||
// All tests are placed in IWRAM in ARM mode.
|
||||
|
||||
@ -11,7 +11,10 @@ namespace test{
|
||||
bool fixed_suite::addition() {
|
||||
struct {
|
||||
NOINLINE fixed operator()(fixed x, fixed y) {
|
||||
return x + y;
|
||||
start_timer();
|
||||
fixed r = x + y;
|
||||
end_timer();
|
||||
return r;
|
||||
}
|
||||
} f;
|
||||
|
||||
@ -21,7 +24,10 @@ bool fixed_suite::addition() {
|
||||
bool fixed_suite::subtraction() {
|
||||
struct {
|
||||
NOINLINE fixed operator()(fixed x, fixed y) {
|
||||
return x - y;
|
||||
start_timer();
|
||||
fixed r = x - y;
|
||||
end_timer();
|
||||
return r;
|
||||
}
|
||||
} f;
|
||||
|
||||
@ -31,7 +37,10 @@ bool fixed_suite::subtraction() {
|
||||
bool fixed_suite::multiplication() {
|
||||
struct {
|
||||
NOINLINE fixed operator()(fixed x, fixed y) {
|
||||
return x * y;
|
||||
start_timer();
|
||||
fixed r = x * y;
|
||||
end_timer();
|
||||
return r;
|
||||
}
|
||||
} f;
|
||||
|
||||
@ -44,7 +53,10 @@ bool fixed_suite::mult_overflow() {
|
||||
// is used internally)
|
||||
struct {
|
||||
NOINLINE fixed operator()(fixed x, fixed y) {
|
||||
return x * y;
|
||||
start_timer();
|
||||
fixed r = x * y;
|
||||
end_timer();
|
||||
return r;
|
||||
}
|
||||
} f;
|
||||
|
||||
@ -54,7 +66,10 @@ bool fixed_suite::mult_overflow() {
|
||||
bool fixed_suite::division() {
|
||||
struct {
|
||||
NOINLINE fixed operator()(fixed x, fixed y) {
|
||||
return x / y;
|
||||
start_timer();
|
||||
fixed r = x / y;
|
||||
end_timer();
|
||||
return r;
|
||||
}
|
||||
} f;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user