diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/half_float.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/half_float.cpp b/test/half_float.cpp index b2c22197f..1cfe69e93 100644 --- a/test/half_float.cpp +++ b/test/half_float.cpp @@ -168,6 +168,20 @@ void test_arithmetic() VERIFY_IS_APPROX(float(half(1.0f) / half(3.0f)), 0.33333f); VERIFY_IS_EQUAL(float(-half(4096.0f)), -4096.0f); VERIFY_IS_EQUAL(float(-half(-4096.0f)), 4096.0f); + + half x(3); + half y = ++x; + VERIFY_IS_EQUAL(x, half(4)); + VERIFY_IS_EQUAL(y, half(4)); + y = --x; + VERIFY_IS_EQUAL(x, half(3)); + VERIFY_IS_EQUAL(y, half(3)); + y = x++; + VERIFY_IS_EQUAL(x, half(4)); + VERIFY_IS_EQUAL(y, half(3)); + y = x--; + VERIFY_IS_EQUAL(x, half(3)); + VERIFY_IS_EQUAL(y, half(4)); } void test_comparison() |