diff options
author | yzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-17 23:45:24 +0000 |
---|---|---|
committer | yzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-17 23:45:24 +0000 |
commit | fe03d587b3669de9d9437ad22156ccf698cb9d1c (patch) | |
tree | 9d721e11376b7f9fbea26b37e695b3f204cc69de /mojo/public/cpp/bindings/tests/validation_test_input_parser.cc | |
parent | 0624005fc5a555a9269ff68f92ebed93808c5c67 (diff) | |
download | chromium_src-fe03d587b3669de9d9437ad22156ccf698cb9d1c.zip chromium_src-fe03d587b3669de9d9437ad22156ccf698cb9d1c.tar.gz chromium_src-fe03d587b3669de9d9437ad22156ccf698cb9d1c.tar.bz2 |
Mojo validation test input parser: disallow multiple [anchr]s with the same ID.
BUG=None
TEST=None
Review URL: https://codereview.chromium.org/340553002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277905 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/public/cpp/bindings/tests/validation_test_input_parser.cc')
-rw-r--r-- | mojo/public/cpp/bindings/tests/validation_test_input_parser.cc | 6 |
1 files changed, 6 insertions, 0 deletions
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 49544ee..f5a5962 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; + anchors_.insert(value_string); + std::map<std::string, PendingDistanceItem>::iterator iter = pending_distance_items_.find(value_string); if (iter == pending_distance_items_.end()) |