fix vint_test with MCL_USE_GMP=0

update-fork
MITSUNARI Shigeo 5 years ago
parent d3aaf45e0f
commit 0fe07b047c
  1. 4
      test/fp_util_test.cpp
  2. 4
      test/vint_test.cpp

@ -289,7 +289,7 @@ CYBOZU_TEST_AUTO(BitIterator)
while (bi.hasNext()) {
uint32_t v1 = bi.getNext(w);
mpz_class v2 = x & bi.mask(w);
CYBOZU_TEST_EQUAL(v1, v2);
CYBOZU_TEST_EQUAL(v2, v1);
x >>= w;
}
CYBOZU_TEST_EQUAL(x, 0);
@ -302,7 +302,7 @@ CYBOZU_TEST_AUTO(BitIterator)
while (bi.hasNext()) {
uint32_t v1 = bi.peekBit();
mpz_class v2 = x & 1;
CYBOZU_TEST_EQUAL(v1, v2);
CYBOZU_TEST_EQUAL(v2, v1);
x >>= 1;
bi.skipBit();
}

@ -7,7 +7,7 @@
#include <cybozu/benchmark.hpp>
#include <cybozu/test.hpp>
#include <cybozu/xorshift.hpp>
#ifndef DONT_USE_GMP_IN_TEST
#ifndef MCL_USE_VINT
#include <gmpxx.h>
#endif
@ -1259,7 +1259,7 @@ CYBOZU_TEST_AUTO(bench)
x.setStr(tbl[i].x);
y.setStr(tbl[i].y);
CYBOZU_BENCH_C("fast div", N, Vint::div, z, x, y);
#ifndef DONT_USE_GMP_IN_TEST
#ifndef MCL_USE_VINT
{
mpz_class mx(tbl[i].x), my(tbl[i].y), mz;
CYBOZU_BENCH_C("gmp", N, mpz_div, mz.get_mpz_t(), mx.get_mpz_t(), my.get_mpz_t());

Loading…
Cancel
Save