Index: mojo/public/cpp/bindings/tests/validation_unittest.cc |
diff --git a/mojo/public/cpp/bindings/tests/validation_unittest.cc b/mojo/public/cpp/bindings/tests/validation_unittest.cc |
index c15ff0291a7b74d3df324f98c6ad333d626bdc10..963da7e4b2ce219dd47f7a722593057c2bfc25f5 100644 |
--- a/mojo/public/cpp/bindings/tests/validation_unittest.cc |
+++ b/mojo/public/cpp/bindings/tests/validation_unittest.cc |
@@ -371,6 +371,18 @@ TEST_F(ValidationTest, Conformance) { |
RunValidationTests("conformance_", validators.GetHead()); |
} |
+// This test is similar to Conformance test but its goal is specifically |
+// do bounds-check testing of message validation. For example we test the |
+// detection of off-by-one errors in method ordinals. |
+TEST_F(ValidationTest, BoundsCheck) { |
+ DummyMessageReceiver dummy_receiver; |
+ mojo::internal::FilterChain validators(&dummy_receiver); |
+ validators.Append<mojo::internal::MessageHeaderValidator>(); |
+ validators.Append<BoundsCheckTestInterface::RequestValidator_>(); |
+ |
+ RunValidationTests("boundscheck_", validators.GetHead()); |
+} |
+ |
// This test is similar to the Conformance test but for responses. |
TEST_F(ValidationTest, ResponseConformance) { |
DummyMessageReceiver dummy_receiver; |
@@ -381,6 +393,17 @@ TEST_F(ValidationTest, ResponseConformance) { |
RunValidationTests("resp_conformance_", validators.GetHead()); |
} |
+// This test is similar to the BoundsCheck test but for responses. |
+// Any changes to the |
yzshen1
2015/04/06 18:41:22
In complete comment.
rudominer
2015/04/10 18:13:16
Done.
|
+TEST_F(ValidationTest, ResponseBoundsCheck) { |
+ DummyMessageReceiver dummy_receiver; |
+ mojo::internal::FilterChain validators(&dummy_receiver); |
+ validators.Append<mojo::internal::MessageHeaderValidator>(); |
+ validators.Append<BoundsCheckTestInterface::ResponseValidator_>(); |
+ |
+ RunValidationTests("resp_boundscheck_", validators.GetHead()); |
+} |
+ |
// Test that InterfacePtr<X> applies the correct validators and they don't |
// conflict with each other: |
// - MessageHeaderValidator |