Address warnings in CDM unittests
[ Merge of http://go/wvgerrit/24600 ] Test: Unit test only change. Verified by rerunning unittests. b/36221430 Change-Id: I36a8a0a5df400673689280cbf53ba9394f827c90
This commit is contained in:
@@ -171,7 +171,7 @@ TEST_F(FileTest, ListFiles) {
|
|||||||
EXPECT_TRUE(file_system.List(path_dir, &names));
|
EXPECT_TRUE(file_system.List(path_dir, &names));
|
||||||
|
|
||||||
// Should find three files. Order not important.
|
// Should find three files. Order not important.
|
||||||
EXPECT_EQ(3, names.size());
|
EXPECT_EQ(3u, names.size());
|
||||||
EXPECT_THAT(names, ::testing::UnorderedElementsAre(kTestFileName,
|
EXPECT_THAT(names, ::testing::UnorderedElementsAre(kTestFileName,
|
||||||
kTestFileName2,
|
kTestFileName2,
|
||||||
kTestFileName3));
|
kTestFileName3));
|
||||||
@@ -180,14 +180,14 @@ TEST_F(FileTest, ListFiles) {
|
|||||||
EXPECT_TRUE(file_system.Remove(wild_card_path));
|
EXPECT_TRUE(file_system.Remove(wild_card_path));
|
||||||
EXPECT_TRUE(file_system.List(path_dir, &names));
|
EXPECT_TRUE(file_system.List(path_dir, &names));
|
||||||
|
|
||||||
EXPECT_EQ(1, names.size());
|
EXPECT_EQ(1u, names.size());
|
||||||
EXPECT_TRUE(names[0].compare(kTestFileName3) == 0);
|
EXPECT_TRUE(names[0].compare(kTestFileName3) == 0);
|
||||||
|
|
||||||
std::string wild_card_path2 = path_dir + kWildcard + kTestFileNameExt3;
|
std::string wild_card_path2 = path_dir + kWildcard + kTestFileNameExt3;
|
||||||
EXPECT_TRUE(file_system.Remove(wild_card_path2));
|
EXPECT_TRUE(file_system.Remove(wild_card_path2));
|
||||||
EXPECT_TRUE(file_system.List(path_dir, &names));
|
EXPECT_TRUE(file_system.List(path_dir, &names));
|
||||||
|
|
||||||
EXPECT_EQ(0, names.size());
|
EXPECT_EQ(0u, names.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace wvcdm
|
} // namespace wvcdm
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ class LicenseKeysTest : public ::testing::Test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int content_key_count_;
|
size_t content_key_count_;
|
||||||
LicenseKeys license_keys_;
|
LicenseKeys license_keys_;
|
||||||
License license_;
|
License license_;
|
||||||
};
|
};
|
||||||
@@ -495,7 +495,7 @@ TEST_F(LicenseKeysTest, ExtractKeyStatuses) {
|
|||||||
CdmKeyStatusMap key_status_map;
|
CdmKeyStatusMap key_status_map;
|
||||||
StageOperatorSessionKeys();
|
StageOperatorSessionKeys();
|
||||||
license_keys_.ExtractKeyStatuses(&key_status_map);
|
license_keys_.ExtractKeyStatuses(&key_status_map);
|
||||||
EXPECT_EQ(0, key_status_map.size());
|
EXPECT_EQ(0u, key_status_map.size());
|
||||||
StageContentKeys();
|
StageContentKeys();
|
||||||
license_keys_.ExtractKeyStatuses(&key_status_map);
|
license_keys_.ExtractKeyStatuses(&key_status_map);
|
||||||
EXPECT_EQ(content_key_count_, key_status_map.size());
|
EXPECT_EQ(content_key_count_, key_status_map.size());
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ TEST_F(EventMetricTest, NoFieldsSuccessNullCallback) {
|
|||||||
metric.Record(10LL);
|
metric.Record(10LL);
|
||||||
|
|
||||||
std::map<std::string, Distribution*> value_map = GetValueMap(metric);
|
std::map<std::string, Distribution*> value_map = GetValueMap(metric);
|
||||||
ASSERT_EQ(1, GetValueMap(metric).size());
|
ASSERT_EQ(1u, GetValueMap(metric).size());
|
||||||
EXPECT_EQ(2, value_map.begin()->second->Count());
|
EXPECT_EQ(2, value_map.begin()->second->Count());
|
||||||
EXPECT_EQ("", value_map.begin()->first);
|
EXPECT_EQ("", value_map.begin()->first);
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ TEST_F(EventMetricTest, NoFieldsSuccessWithCallback) {
|
|||||||
metric.Publish(mock_notification_.get());
|
metric.Publish(mock_notification_.get());
|
||||||
|
|
||||||
std::map<std::string, Distribution*> value_map = GetValueMap(metric);
|
std::map<std::string, Distribution*> value_map = GetValueMap(metric);
|
||||||
ASSERT_EQ(1, GetValueMap(metric).size());
|
ASSERT_EQ(1u, GetValueMap(metric).size());
|
||||||
EXPECT_EQ(1, value_map.begin()->second->Count());
|
EXPECT_EQ(1, value_map.begin()->second->Count());
|
||||||
EXPECT_EQ("", value_map.begin()->first);
|
EXPECT_EQ("", value_map.begin()->first);
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,7 @@ TEST_F(EventMetricTest, OneFieldSuccessNoCallback) {
|
|||||||
metric.Record(11LL, 13);
|
metric.Record(11LL, 13);
|
||||||
metric.Record(12LL, 13);
|
metric.Record(12LL, 13);
|
||||||
std::map<std::string, Distribution*> value_map = GetValueMap(metric);
|
std::map<std::string, Distribution*> value_map = GetValueMap(metric);
|
||||||
ASSERT_EQ(2, GetValueMap(metric).size());
|
ASSERT_EQ(2u, GetValueMap(metric).size());
|
||||||
|
|
||||||
// Verify both instances.
|
// Verify both instances.
|
||||||
// TODO(blueeyes): Export MakeFieldNameString so it can be used here.
|
// TODO(blueeyes): Export MakeFieldNameString so it can be used here.
|
||||||
@@ -113,7 +113,7 @@ TEST_F(EventMetricTest, TwoFieldsSuccess) {
|
|||||||
metric.Record(5, 7, 23);
|
metric.Record(5, 7, 23);
|
||||||
|
|
||||||
std::map<std::string, Distribution*> value_map = GetValueMap(metric);
|
std::map<std::string, Distribution*> value_map = GetValueMap(metric);
|
||||||
ASSERT_EQ(4, GetValueMap(metric).size());
|
ASSERT_EQ(4u, GetValueMap(metric).size());
|
||||||
|
|
||||||
// Verify all instances.
|
// Verify all instances.
|
||||||
Distribution* distribution_7_23 = value_map["{error_code:7&size:23}"];
|
Distribution* distribution_7_23 = value_map["{error_code:7&size:23}"];
|
||||||
@@ -172,7 +172,7 @@ TEST_F(EventMetricTest, ThreeFieldsSuccess) {
|
|||||||
|
|
||||||
|
|
||||||
std::map<std::string, Distribution*> value_map = GetValueMap(metric);
|
std::map<std::string, Distribution*> value_map = GetValueMap(metric);
|
||||||
ASSERT_EQ(1, GetValueMap(metric).size());
|
ASSERT_EQ(1u, GetValueMap(metric).size());
|
||||||
EXPECT_EQ("{error_code:7&size:13&woke up happy:0}",
|
EXPECT_EQ("{error_code:7&size:13&woke up happy:0}",
|
||||||
value_map.begin()->first);
|
value_map.begin()->first);
|
||||||
EXPECT_EQ(1, value_map.begin()->second->Count());
|
EXPECT_EQ(1, value_map.begin()->second->Count());
|
||||||
@@ -188,7 +188,7 @@ TEST_F(EventMetricTest, FourFieldsSuccess) {
|
|||||||
metric.Record(10LL, 7, 13, true, "find your true love");
|
metric.Record(10LL, 7, 13, true, "find your true love");
|
||||||
|
|
||||||
std::map<std::string, Distribution*> value_map = GetValueMap(metric);
|
std::map<std::string, Distribution*> value_map = GetValueMap(metric);
|
||||||
ASSERT_EQ(1, GetValueMap(metric).size());
|
ASSERT_EQ(1u, GetValueMap(metric).size());
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
"{error_code:7&size:13&woke up happy:1&horoscope:find your true love}",
|
"{error_code:7&size:13&woke up happy:1&horoscope:find your true love}",
|
||||||
value_map.begin()->first);
|
value_map.begin()->first);
|
||||||
|
|||||||
Reference in New Issue
Block a user