Add some tests for double comparison

More testing the engine than the compiler, but hey :)
This commit is contained in:
Bill Currie 2020-02-15 23:43:33 +09:00
parent bab3752e98
commit db9996023f

View file

@ -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 ()
{ {