From e401a282d33fc69717cf0925e35721282d58a77d Mon Sep 17 00:00:00 2001 From: AztecBot Date: Mon, 6 Apr 2026 17:26:47 +0000 Subject: [PATCH] fix: skip MsgpackRejectsNonCanonical test in WASM builds --- .../cpp/src/barretenberg/ecc/fields/prime_field.test.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/barretenberg/cpp/src/barretenberg/ecc/fields/prime_field.test.cpp b/barretenberg/cpp/src/barretenberg/ecc/fields/prime_field.test.cpp index 54a5a8546751..e69eb7f2130d 100644 --- a/barretenberg/cpp/src/barretenberg/ecc/fields/prime_field.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ecc/fields/prime_field.test.cpp @@ -615,6 +615,9 @@ TYPED_TEST(PrimeFieldTest, Msgpack) EXPECT_EQ(actual, expected); } +// This test requires exception support; in WASM builds (BB_NO_EXCEPTIONS), +// throw_or_abort calls abort() instead of throwing, so EXPECT_THROW cannot work. +#ifndef BB_NO_EXCEPTIONS TYPED_TEST(PrimeFieldTest, MsgpackRejectsNonCanonical) { using F = TypeParam; @@ -654,6 +657,12 @@ TYPED_TEST(PrimeFieldTest, MsgpackRejectsNonCanonical) }, std::runtime_error); } +#else +TYPED_TEST(PrimeFieldTest, MsgpackRejectsNonCanonical) +{ + GTEST_SKIP() << "Skipping: throw_or_abort calls abort() when BB_NO_EXCEPTIONS is defined"; +} +#endif // ================================ // Montgomery Form Conversion Tests (254-bit fields)