mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Add some tests for double comparison
More testing the engine than the compiler, but hey :)
This commit is contained in:
parent
bab3752e98
commit
db9996023f
1 changed files with 40 additions and 0 deletions
|
@ -35,6 +35,46 @@ test_constant ()
|
||||||
return fail;
|
return fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double less = 3;
|
||||||
|
double greater_equal = 3;
|
||||||
|
double less_equal = 5;
|
||||||
|
double greater = 5;
|
||||||
|
|
||||||
|
int
|
||||||
|
test_copare ()
|
||||||
|
{
|
||||||
|
int fail = 0;
|
||||||
|
|
||||||
|
fail |= !(less < greater);
|
||||||
|
fail |= (less > greater);
|
||||||
|
fail |= !(less != greater);
|
||||||
|
fail |= (less == greater);
|
||||||
|
fail |= !(less <= greater);
|
||||||
|
fail |= (less >= greater);
|
||||||
|
|
||||||
|
fail |= (less_equal < greater);
|
||||||
|
fail |= (less_equal > greater);
|
||||||
|
fail |= !(less_equal == greater);
|
||||||
|
fail |= (less_equal != greater);
|
||||||
|
fail |= !(less_equal <= greater);
|
||||||
|
fail |= !(less_equal >= greater);
|
||||||
|
|
||||||
|
fail |= (greater < less);
|
||||||
|
fail |= !(greater > less);
|
||||||
|
fail |= !(greater != less);
|
||||||
|
fail |= (greater == less);
|
||||||
|
fail |= (greater <= less);
|
||||||
|
fail |= !(greater >= less);
|
||||||
|
|
||||||
|
fail |= (greater_equal < less);
|
||||||
|
fail |= (greater_equal > less);
|
||||||
|
fail |= !(greater_equal == less);
|
||||||
|
fail |= (greater_equal != less);
|
||||||
|
fail |= !(greater_equal <= less);
|
||||||
|
fail |= !(greater_equal >= less);
|
||||||
|
return fail;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
test_ops ()
|
test_ops ()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue