Chromium Code Reviews| Index: mojo/public/cpp/bindings/tests/validation_test_input_parser.cc |
| diff --git a/mojo/public/cpp/bindings/tests/validation_test_input_parser.cc b/mojo/public/cpp/bindings/tests/validation_test_input_parser.cc |
| index 49544ee61215b6ec0278d7eb7e3eff3afaa2b65b..f5a5962d9f87510b5e5db3758685f7c4f8b41ab1 100644 |
| --- a/mojo/public/cpp/bindings/tests/validation_test_input_parser.cc |
| +++ b/mojo/public/cpp/bindings/tests/validation_test_input_parser.cc |
| @@ -10,6 +10,7 @@ |
| #include <limits> |
| #include <map> |
| +#include <set> |
| #include <utility> |
| #include "mojo/public/c/system/macros.h" |
| @@ -112,6 +113,7 @@ class ValidationTestInputParser { |
| std::string* error_message_; |
| std::map<std::string, PendingDistanceItem> pending_distance_items_; |
| + std::set<std::string> anchors_; |
| }; |
| #define DATA_TYPE(name, data_size, parse_data_func) \ |
| @@ -329,6 +331,10 @@ bool ValidationTestInputParser::ParseDistance(const DataType& type, |
| bool ValidationTestInputParser::ParseAnchor(const DataType& type, |
| const std::string& value_string) { |
| + if (anchors_.find(value_string) != anchors_.end()) |
| + return false; |
|
Tom Sepez
2014/06/17 17:38:33
do we want to set *error_message_ here?
yzshen1
2014/06/17 17:41:24
It will be the general error "Error occurred when
|
| + anchors_.insert(value_string); |
| + |
| std::map<std::string, PendingDistanceItem>::iterator iter = |
| pending_distance_items_.find(value_string); |
| if (iter == pending_distance_items_.end()) |