diff options
author | gatecat <gatecat@ds0.me> | 2021-02-25 14:29:17 +0000 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2021-02-25 14:29:17 +0000 |
commit | 34c511444eff51291fa732369e434ff687de310f (patch) | |
tree | 9b1ea2a93a9c05a94248de93aba6129def918e53 | |
parent | 32db04a11077e7a32adc6f3d473e5cbefe83ff0a (diff) | |
download | nextpnr-tests-34c511444eff51291fa732369e434ff687de310f.tar.gz nextpnr-tests-34c511444eff51291fa732369e434ff687de310f.tar.bz2 nextpnr-tests-34c511444eff51291fa732369e434ff687de310f.zip |
Fix compiler warnings in tests
Signed-off-by: gatecat <gatecat@ds0.me>
-rw-r--r-- | fpga_interchange/bits.cc | 8 | ||||
-rw-r--r-- | fpga_interchange/dynamic_bitarray.cc | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/fpga_interchange/bits.cc b/fpga_interchange/bits.cc index ede058c..ac92edd 100644 --- a/fpga_interchange/bits.cc +++ b/fpga_interchange/bits.cc @@ -45,13 +45,13 @@ TEST_F(BitsTest, popcount) TEST_F(BitsTest, ctz) { for (size_t i = 0; i < std::numeric_limits<unsigned int>::digits; ++i) { - ASSERT_EQ(Bits::ctz(1 << i), i); - ASSERT_EQ(Bits::generic_ctz(1 << i), i); + ASSERT_EQ(Bits::ctz(1 << i), int(i)); + ASSERT_EQ(Bits::generic_ctz(1 << i), int(i)); } for (size_t i = 0; i < std::numeric_limits<unsigned int>::digits - 1; ++i) { - ASSERT_EQ(Bits::ctz((1 << i) | (1 << (i + 1))), i); - ASSERT_EQ(Bits::generic_ctz((1 << i) | (1 << (i + 1))), i); + ASSERT_EQ(Bits::ctz((1 << i) | (1 << (i + 1))), int(i)); + ASSERT_EQ(Bits::generic_ctz((1 << i) | (1 << (i + 1))), int(i)); } } diff --git a/fpga_interchange/dynamic_bitarray.cc b/fpga_interchange/dynamic_bitarray.cc index 6925769..0e1a4a7 100644 --- a/fpga_interchange/dynamic_bitarray.cc +++ b/fpga_interchange/dynamic_bitarray.cc @@ -33,12 +33,12 @@ TEST_F(DynamicBitarrayTest, oneshot) for (size_t i = 0; i < 100; ++i) { std::vector<uint8_t> simple_storage; nextpnr::DynamicBitarray<> bitarray; - ASSERT_EQ(bitarray.bits_per_value(), CHAR_BIT); + ASSERT_EQ(bitarray.bits_per_value(), size_t(CHAR_BIT)); simple_storage.resize(i); bitarray.resize(i); ASSERT_LE(i, bitarray.size()); - ASSERT_LT(bitarray.size() - i, CHAR_BIT); + ASSERT_LT(bitarray.size() - i, size_t(CHAR_BIT)); for (size_t k = 0; k < 3; ++k) { for (size_t j = 0; j < i; ++j) { |