Commit 33eddd21 authored by yb9976's avatar yb9976
Browse files

Improve readability of unit tests

parent c9656474
......@@ -22,7 +22,7 @@ int main(void)
assert(get_entity_owner(x) == cls);
ir_entity *gx = ir_get_global(id1);
assert (NULL == gx);
assert(gx == NULL);
set_entity_owner(x, glob);
assert(get_entity_owner(x) == glob);
......
......@@ -13,7 +13,7 @@
static int64_t nan_payload(double d) {
int64_t result;
memcpy(&result, &d, 8);
assert (result & 0x0008000000000000); // quiet NaN
assert(result & 0x0008000000000000); // quiet NaN
return result & 0x0007ffffffffffff;
}
......@@ -32,35 +32,35 @@ int main(void)
init_mode();
init_tarval_2();
double d_nan = 0.0/0.0;
assert (d_nan != d_nan);
double d_nan = 0.0 / 0.0;
assert(d_nan != d_nan);
d_nan = new_nan(1234);
assert (d_nan != d_nan);
assert (nan_payload(d_nan) == 1234);
assert(d_nan != d_nan);
assert(nan_payload(d_nan) == 1234);
d_nan *= 2;
assert (d_nan != d_nan);
assert(d_nan != d_nan);
ir_tarval* tv_nan = new_tarval_from_double(d_nan, mode_D);
assert (tarval_is_nan(tv_nan));
assert(tarval_is_nan(tv_nan));
d_nan = get_tarval_double(tv_nan);
assert (d_nan != d_nan);
assert (nan_payload(d_nan) == 1234);
assert(d_nan != d_nan);
assert(nan_payload(d_nan) == 1234);
tv_nan = new_tarval_nan(mode_D, false, NULL);
assert (tarval_is_nan(tv_nan));
assert(tarval_is_nan(tv_nan));
d_nan = get_tarval_double(tv_nan);
assert (d_nan != d_nan);
assert(d_nan != d_nan);
d_nan = new_nan(0);
assert (nan_payload(d_nan) == 0);
assert (d_nan != d_nan);
assert(nan_payload(d_nan) == 0);
assert(d_nan != d_nan);
tv_nan = new_tarval_from_double(d_nan, mode_D);
assert (tarval_is_nan(tv_nan));
assert(tarval_is_nan(tv_nan));
d_nan = get_tarval_double(tv_nan);
assert (d_nan != d_nan);
assert (nan_payload(d_nan) == 0);
assert(d_nan != d_nan);
assert(nan_payload(d_nan) == 0);
finish_tarval();
finish_mode();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment