diff --git a/test/mont_fp_test.cpp b/test/mont_fp_test.cpp index c6b7894..742b88e 100644 --- a/test/mont_fp_test.cpp +++ b/test/mont_fp_test.cpp @@ -201,11 +201,11 @@ struct Test { str = x.toStr(); CYBOZU_TEST_EQUAL(str, "0"); str = x.toStr(2, true); - CYBOZU_TEST_EQUAL(str, "0"); + CYBOZU_TEST_EQUAL(str, "0b0"); str = x.toStr(2, false); CYBOZU_TEST_EQUAL(str, "0"); str = x.toStr(16, true); - CYBOZU_TEST_EQUAL(str, "0"); + CYBOZU_TEST_EQUAL(str, "0x0"); str = x.toStr(16, false); CYBOZU_TEST_EQUAL(str, "0"); @@ -526,14 +526,15 @@ struct Test { { const struct { const char *p; - uint64_t i; + int64_t i; } tbl[] = { { "0x1234567812345678", uint64_t(0x1234567812345678ull) }, - { "0xaaaaaaaaaaaaaaaa", uint64_t(0xaaaaaaaaaaaaaaaaull) }, + { "0x1234567812345678", int64_t(0x1234567812345678ll) }, }; for (size_t i = 0; i < CYBOZU_NUM_OF_ARRAY(tbl); i++) { Fp x(tbl[i].p); Fp y(tbl[i].i); + if (tbl[i].i < 0) x = -x; CYBOZU_TEST_EQUAL(x, y); } }