Skip to content

Commit

Permalink
unittest_mon_pgmap: fix warnings
Browse files Browse the repository at this point in the history
In file included from test/mon/PGMap.cc:15:0:
../src/gtest/include/gtest/gtest.h: In function ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int, T2 = unsigned int]’:
../src/gtest/include/gtest/gtest.h:1300:30: instantiated from ‘static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, const T2&) [with T1 = int, T2 = unsigned int, bool lhs_is_null_literal = false]’
test/mon/PGMap.cc:33:257: instantiated from here
warning: ../src/gtest/include/gtest/gtest.h:1263:3: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
Sage Weil committed Mar 14, 2014
1 parent e941fef commit 6f9db6c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/test/mon/PGMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,54 +30,54 @@ TEST(pgmap, min_last_epoch_clean)
inc.version = 1;
inc.update_stat(0, 123, os);
pg_map.apply_incremental(g_ceph_context, inc);
ASSERT_EQ(123, pg_map.calc_min_last_epoch_clean());
ASSERT_EQ(123u, pg_map.calc_min_last_epoch_clean());

inc = PGMap::Incremental();
inc.version = 2;
inc.update_stat(1, 222, os);
pg_map.apply_incremental(g_ceph_context, inc);
ASSERT_EQ(123, pg_map.calc_min_last_epoch_clean());
ASSERT_EQ(123u, pg_map.calc_min_last_epoch_clean());

inc = PGMap::Incremental();
inc.version = 3;
inc.update_stat(0, 222, os);
pg_map.apply_incremental(g_ceph_context, inc);
ASSERT_EQ(222, pg_map.calc_min_last_epoch_clean());
ASSERT_EQ(222u, pg_map.calc_min_last_epoch_clean());

inc = PGMap::Incremental();
inc.version = 4;
inc.update_stat(0, 333, os);
inc.update_stat(1, 333, os);
pg_map.apply_incremental(g_ceph_context, inc);
ASSERT_EQ(333, pg_map.calc_min_last_epoch_clean());
ASSERT_EQ(333u, pg_map.calc_min_last_epoch_clean());

ps.last_epoch_clean = 222;
inc = PGMap::Incremental();
inc.version = 5;
inc.pg_stat_updates[pg_t(1,1)] = ps;
pg_map.apply_incremental(g_ceph_context, inc);
ASSERT_EQ(222, pg_map.calc_min_last_epoch_clean());
ASSERT_EQ(222u, pg_map.calc_min_last_epoch_clean());

ps.last_epoch_clean = 223;
inc = PGMap::Incremental();
inc.version = 6;
inc.pg_stat_updates[pg_t(1,1)] = ps;
pg_map.apply_incremental(g_ceph_context, inc);
ASSERT_EQ(223, pg_map.calc_min_last_epoch_clean());
ASSERT_EQ(223u, pg_map.calc_min_last_epoch_clean());

ps.last_epoch_clean = 224;
inc = PGMap::Incremental();
inc.version = 7;
inc.pg_stat_updates[pg_t(2,2)] = ps;
pg_map.apply_incremental(g_ceph_context, inc);
ASSERT_EQ(223, pg_map.calc_min_last_epoch_clean());
ASSERT_EQ(223u, pg_map.calc_min_last_epoch_clean());

ps.last_epoch_clean = 225;
inc = PGMap::Incremental();
inc.version = 8;
inc.pg_stat_updates[pg_t(1,1)] = ps;
pg_map.apply_incremental(g_ceph_context, inc);
ASSERT_EQ(224, pg_map.calc_min_last_epoch_clean());
ASSERT_EQ(224u, pg_map.calc_min_last_epoch_clean());

}

Expand Down

0 comments on commit 6f9db6c

Please sign in to comment.