summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbatsumaru <>2026-08-10 19:13:28 +0900
committerbatsumaru <>2026-08-10 19:14:16 +0900
commit1fe44b8855c0e83c443e8cbaeeedf25fbe342849 (patch)
tree0a3e50a9b885160b96ce134c10168be3eea8cfc0
parent0604aba2bfbd375a361fcc845b5655caa232a880 (diff)
Added multplication fuzz test
-rw-r--r--tests/test_fixed_point.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_fixed_point.cpp b/tests/test_fixed_point.cpp
index 87a6ef2..e783f5f 100644
--- a/tests/test_fixed_point.cpp
+++ b/tests/test_fixed_point.cpp
@@ -115,6 +115,13 @@ TEST_CASE("fp_t addition is commutative for any bit pattern (fuzzed)") {
});
}
+TEST_CASE("fp_t multiplication is commutative for any bit pattern (fuzzed)") {
+ rc::prop("a * b == b * a",
+ [](const fp_t&a, const fp_t& b) {
+ RC_ASSERT(a * b == b * a);
+ });
+}
+
TEST_CASE("fp_t division by itself is identity for any nonzero value (fuzzed)") {
rc::prop("a / a == from_int(1) when a.raw != 0",
[](const fp_t& a) {