summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorbatsumaru <>2026-08-09 10:54:32 +0900
committerbatsumaru <>2026-08-09 10:54:32 +0900
commit86e6b2a2a35f46550439262978d52bdeb93c6dc6 (patch)
tree06324833942126ca5132ec595d8880c8a8a55eed /tests
Initial commit, fixed point addition
Diffstat (limited to 'tests')
-rw-r--r--tests/test_fixed_point.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_fixed_point.cpp b/tests/test_fixed_point.cpp
new file mode 100644
index 0000000..8cb12d2
--- /dev/null
+++ b/tests/test_fixed_point.cpp
@@ -0,0 +1,9 @@
+#include <catch2/catch_test_macros.hpp>
+#include "fixed_point.h"
+
+TEST_CASE("fp_t addition is commutative") {
+ fp_t a = fp_t::from_int(1);
+ fp_t b = fp_t::from_int(2);
+ CHECK(a + b == b + a);
+ REQUIRE(a.raw != 0);
+}