Fix clang compiler warnings

main
Chilledheart 11 years ago
parent f4c49aeade
commit 54f4e2f188
  1. 8
      db/db_iter_test.cc
  2. 6
      db/version_set_test.cc
  3. 2
      table/plain_table_reader.h
  4. 4
      utilities/document/json_document_test.cc

@ -323,23 +323,23 @@ TEST(DBIteratorTest, DBIteratorUseSkipCountSkips) {
ASSERT_TRUE(db_iter->Valid()); ASSERT_TRUE(db_iter->Valid());
ASSERT_EQ(db_iter->key().ToString(), "c"); ASSERT_EQ(db_iter->key().ToString(), "c");
ASSERT_EQ(db_iter->value().ToString(), "c"); ASSERT_EQ(db_iter->value().ToString(), "c");
ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 1); ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 1u);
db_iter->Prev(); db_iter->Prev();
ASSERT_TRUE(db_iter->Valid()); ASSERT_TRUE(db_iter->Valid());
ASSERT_EQ(db_iter->key().ToString(), "b"); ASSERT_EQ(db_iter->key().ToString(), "b");
ASSERT_EQ(db_iter->value().ToString(), "b"); ASSERT_EQ(db_iter->value().ToString(), "b");
ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 2); ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 2u);
db_iter->Prev(); db_iter->Prev();
ASSERT_TRUE(db_iter->Valid()); ASSERT_TRUE(db_iter->Valid());
ASSERT_EQ(db_iter->key().ToString(), "a"); ASSERT_EQ(db_iter->key().ToString(), "a");
ASSERT_EQ(db_iter->value().ToString(), "a"); ASSERT_EQ(db_iter->value().ToString(), "a");
ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 3); ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 3u);
db_iter->Prev(); db_iter->Prev();
ASSERT_TRUE(!db_iter->Valid()); ASSERT_TRUE(!db_iter->Valid());
ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 3); ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 3u);
} }
TEST(DBIteratorTest, DBIteratorUseSkip) { TEST(DBIteratorTest, DBIteratorUseSkip) {

@ -51,14 +51,14 @@ class GenerateFileLevelTest {
TEST(GenerateFileLevelTest, Empty) { TEST(GenerateFileLevelTest, Empty) {
DoGenerateFileLevel(&file_level_, files_, &arena_); DoGenerateFileLevel(&file_level_, files_, &arena_);
ASSERT_EQ(0, file_level_.num_files); ASSERT_EQ(0u, file_level_.num_files);
ASSERT_EQ(0, Compare()); ASSERT_EQ(0, Compare());
} }
TEST(GenerateFileLevelTest, Single) { TEST(GenerateFileLevelTest, Single) {
Add("p", "q"); Add("p", "q");
DoGenerateFileLevel(&file_level_, files_, &arena_); DoGenerateFileLevel(&file_level_, files_, &arena_);
ASSERT_EQ(1, file_level_.num_files); ASSERT_EQ(1u, file_level_.num_files);
ASSERT_EQ(0, Compare()); ASSERT_EQ(0, Compare());
} }
@ -69,7 +69,7 @@ TEST(GenerateFileLevelTest, Multiple) {
Add("300", "350"); Add("300", "350");
Add("400", "450"); Add("400", "450");
DoGenerateFileLevel(&file_level_, files_, &arena_); DoGenerateFileLevel(&file_level_, files_, &arena_);
ASSERT_EQ(4, file_level_.num_files); ASSERT_EQ(4u, file_level_.num_files);
ASSERT_EQ(0, Compare()); ASSERT_EQ(0, Compare());
} }

@ -26,7 +26,7 @@
namespace rocksdb { namespace rocksdb {
class Block; class Block;
class BlockContents; struct BlockContents;
class BlockHandle; class BlockHandle;
class Footer; class Footer;
struct Options; struct Options;

@ -54,7 +54,7 @@ class JSONDocumentTest {
ASSERT_TRUE(json.Contains("properties")); ASSERT_TRUE(json.Contains("properties"));
ASSERT_TRUE(json["properties"].Contains("flags")); ASSERT_TRUE(json["properties"].Contains("flags"));
ASSERT_TRUE(json["properties"]["flags"].IsArray()); ASSERT_TRUE(json["properties"]["flags"].IsArray());
ASSERT_EQ(3, json["properties"]["flags"].Count()); ASSERT_EQ(3u, json["properties"]["flags"].Count());
ASSERT_TRUE(json["properties"]["flags"][0].IsInt64()); ASSERT_TRUE(json["properties"]["flags"][0].IsInt64());
ASSERT_EQ(10, json["properties"]["flags"][0].GetInt64()); ASSERT_EQ(10, json["properties"]["flags"][0].GetInt64());
ASSERT_TRUE(json["properties"]["flags"][1].IsString()); ASSERT_TRUE(json["properties"]["flags"][1].IsString());
@ -74,7 +74,7 @@ class JSONDocumentTest {
ASSERT_EQ(0U, expected.size()); ASSERT_EQ(0U, expected.size());
ASSERT_TRUE(json.Contains("latlong")); ASSERT_TRUE(json.Contains("latlong"));
ASSERT_TRUE(json["latlong"].IsArray()); ASSERT_TRUE(json["latlong"].IsArray());
ASSERT_EQ(2, json["latlong"].Count()); ASSERT_EQ(2u, json["latlong"].Count());
ASSERT_TRUE(json["latlong"][0].IsDouble()); ASSERT_TRUE(json["latlong"][0].IsDouble());
ASSERT_EQ(53.25, json["latlong"][0].GetDouble()); ASSERT_EQ(53.25, json["latlong"][0].GetDouble());
ASSERT_TRUE(json["latlong"][1].IsDouble()); ASSERT_TRUE(json["latlong"][1].IsDouble());

Loading…
Cancel
Save