tests: avoid signed/unsigned compares

Container indices are size_t, and in other places we gratuituously
declare a limit as unsigned and the loop index as signed.

Tests: unit (release)
Message-Id: <20180212121642.10525-1-avi@scylladb.com>
This commit is contained in:
Avi Kivity
2018-02-12 14:16:42 +02:00
committed by Duarte Nunes
parent 87f10bc853
commit e77ecda1da
3 changed files with 5 additions and 5 deletions

View File

@@ -513,7 +513,7 @@ void test_flat_stream(schema_ptr s, std::vector<mutation> muts, reversed_partiti
if (thread) {
auto filter = [&] (const dht::decorated_key& dk) {
for (auto j = 0; j < muts.size(); j += 2) {
for (auto j = size_t(0); j < muts.size(); j += 2) {
if (dk.equal(*s, muts[j].decorated_key())) {
return false;
}
@@ -524,7 +524,7 @@ void test_flat_stream(schema_ptr s, std::vector<mutation> muts, reversed_partiti
fmr = flat_mutation_reader_from_mutations(muts);
muts2 = fmr.consume_in_thread(flat_stream_consumer(s, reversed), std::move(filter));
BOOST_REQUIRE_EQUAL(muts.size() / 2, muts2.size());
for (auto j = 1; j < muts.size(); j += 2) {
for (auto j = size_t(1); j < muts.size(); j += 2) {
BOOST_REQUIRE_EQUAL(muts[j], muts2[j / 2]);
}
}
@@ -601,7 +601,7 @@ SEASTAR_TEST_CASE(test_make_forwardable) {
rd2.fast_forward_to(remaining_range);
for (int i = 1; i < ms.size(); ++i) {
for (auto i = size_t(1); i < ms.size(); ++i) {
test(rd2, ms[i]);
}
});

View File

@@ -158,7 +158,7 @@ public:
};
std::vector<shared_sstable> ssts;
for (auto i = 0; i < _cfg.sstables; i++) {
for (auto i = 0u; i < _cfg.sstables; i++) {
auto sst = sst_gen();
write_memtable_to_sstable(*_mt, sst).get();
sst->open_data().get();

View File

@@ -3744,7 +3744,7 @@ SEASTAR_TEST_CASE(test_skipping_using_index) {
assertions
.produces_partition_start(keys[0])
.fast_forward_to(position_range::all_clustered_rows());
for (auto i = 0; i < rows_per_part; i++) {
for (auto i = 0u; i < rows_per_part; i++) {
assertions.produces_row_with_key(table.make_ckey(i));
}
assertions.produces_end_of_stream();