From 1fe44b8855c0e83c443e8cbaeeedf25fbe342849 Mon Sep 17 00:00:00 2001 From: batsumaru <> Date: Mon, 10 Aug 2026 19:13:28 +0900 Subject: Added multplication fuzz test --- tests/test_fixed_point.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/test_fixed_point.cpp') 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) { -- cgit v1.3