From d086062186d823652c0c108ca7136653ab8a39ca Mon Sep 17 00:00:00 2001 From: Wei Dai Date: Mon, 7 Jun 2021 23:02:00 -0700 Subject: [PATCH] Resolved failed tests on ARM64 by making two tests arch-dependent (issue #347). --- native/tests/seal/util/common.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/native/tests/seal/util/common.cpp b/native/tests/seal/util/common.cpp index 24227575e..abbe47e49 100644 --- a/native/tests/seal/util/common.cpp +++ b/native/tests/seal/util/common.cpp @@ -35,6 +35,9 @@ namespace sealtest unsigned char pos_uc_max = 0xFF; unsigned long long pos_ull = 1; unsigned long long pos_ull_max = 0xFFFFFFFFFFFFFFFF; +#if defined(__aarch64__) || defined(_M_ARM64) + unsigned long long pos_ull_neg_c = 0xFF; +#endif long long neg_ull = -1; ASSERT_TRUE(unsigned_eq(pos_i, pos_i)); @@ -50,7 +53,11 @@ namespace sealtest ASSERT_TRUE(unsigned_geq(pos_uc, pos_c)); ASSERT_TRUE(unsigned_leq(pos_uc, pos_c)); ASSERT_TRUE(unsigned_lt(pos_uc_max, neg_c)); +#if defined(__aarch64__) || defined(_M_ARM64) + ASSERT_TRUE(unsigned_eq(neg_c, pos_ull_neg_c)); +#else ASSERT_TRUE(unsigned_eq(neg_c, pos_ull_max)); +#endif ASSERT_TRUE(unsigned_eq(neg_ull, pos_ull_max)); ASSERT_FALSE(unsigned_lt(neg_ull, pos_ull_max)); ASSERT_TRUE(unsigned_lt(pos_ull, pos_ull_max)); @@ -106,7 +113,11 @@ namespace sealtest ASSERT_TRUE(fits_in(pos_s)); ASSERT_TRUE(fits_in(pos_uc)); ASSERT_FALSE(fits_in(neg_i)); +#if defined(__aarch64__) || defined(_M_ARM64) + ASSERT_TRUE(fits_in(pos_uc_max)); +#else ASSERT_FALSE(fits_in(pos_uc_max)); +#endif ASSERT_TRUE(fits_in(d)); ASSERT_TRUE(fits_in(f)); ASSERT_TRUE(fits_in(d));