Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: mojo/public/cpp/bindings/tests/union_unittest.cc

Issue 1155973004: Add explicit casts from size_t to uint32_t (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: oops Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/tests/union_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/union_unittest.cc b/mojo/public/cpp/bindings/tests/union_unittest.cc
index 65a23fad2ee1a94296c603f9fb0a5011633ecca6..e6e38de3f50cfca3f6d6a0f0443aca310d1c1441 100644
--- a/mojo/public/cpp/bindings/tests/union_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/union_unittest.cc
@@ -499,7 +499,8 @@ TEST(UnionTest, Validation_UnionsInStruct) {
Serialize_(small_struct.Pass(), &buf, &data);
void* raw_buf = buf.Leak();
- mojo::internal::BoundsChecker bounds_checker(data, size, 0);
+ mojo::internal::BoundsChecker bounds_checker(data,
+ static_cast<uint32_t>(size), 0);
EXPECT_TRUE(internal::SmallStruct_Data::Validate(raw_buf, &bounds_checker));
free(raw_buf);
}
@@ -519,7 +520,8 @@ TEST(UnionTest, Validation_PodUnionInStruct_Failure) {
data->pod_union.tag = static_cast<internal::PodUnion_Data::PodUnion_Tag>(100);
void* raw_buf = buf.Leak();
- mojo::internal::BoundsChecker bounds_checker(data, size, 0);
+ mojo::internal::BoundsChecker bounds_checker(data,
+ static_cast<uint32_t>(size), 0);
EXPECT_FALSE(internal::SmallStruct_Data::Validate(raw_buf, &bounds_checker));
free(raw_buf);
}
@@ -537,7 +539,8 @@ TEST(UnionTest, Validation_NullUnion_Failure) {
internal::SmallStructNonNullableUnion_Data::New(&buf);
void* raw_buf = buf.Leak();
- mojo::internal::BoundsChecker bounds_checker(data, size, 0);
+ mojo::internal::BoundsChecker bounds_checker(data,
+ static_cast<uint32_t>(size), 0);
EXPECT_FALSE(internal::SmallStructNonNullableUnion_Data::Validate(
raw_buf, &bounds_checker));
free(raw_buf);
@@ -555,7 +558,8 @@ TEST(UnionTest, Validation_NullableUnion) {
Serialize_(small_struct.Pass(), &buf, &data);
void* raw_buf = buf.Leak();
- mojo::internal::BoundsChecker bounds_checker(data, size, 0);
+ mojo::internal::BoundsChecker bounds_checker(data,
+ static_cast<uint32_t>(size), 0);
EXPECT_TRUE(internal::SmallStruct_Data::Validate(raw_buf, &bounds_checker));
free(raw_buf);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698