Chromium Code Reviews| Index: mojo/public/cpp/bindings/tests/validation_util.h |
| diff --git a/mojo/public/cpp/bindings/tests/validation_util.h b/mojo/public/cpp/bindings/tests/validation_util.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e02b437ead11ba8c80e85bd97eb319bba6e37346 |
| --- /dev/null |
| +++ b/mojo/public/cpp/bindings/tests/validation_util.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +// This file contains utility functions for reading and parsing validation data |
| +// files. |
| + |
| +#ifndef MOJO_PUBLIC_CPP_BINDINGS_TESTS_VALIDATION_UTIL_H_ |
| +#define MOJO_PUBLIC_CPP_BINDINGS_TESTS_VALIDATION_UTIL_H_ |
| + |
| +#include <stddef.h> |
| +#include <stdint.h> |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +namespace mojo { |
| +namespace test { |
| +namespace validation_util { |
| + |
| +// Given |test_name|, which is the filename of a test file (excluding the |
| +// extension), reads in and parses the binary test data (stored in |data|), the |
| +// number of expected handles (stored in |num_handles|), and the expected |
| +// validation string (stored in |expected|). |
| +bool ReadTestCase(const std::string& test_name, |
| + std::vector<uint8_t>* data, |
| + size_t* num_handles, |
| + std::string* expected); |
| + |
| +// Gets a list of matching tests with prefix |prefix|; these list of tests are |
| +// file names of the tests, without the '.data' extension. |
| +std::vector<std::string> GetMatchingTests(const std::string& prefix); |
| + |
| +} // namespace mojo |
|
viettrungluu
2016/07/28 23:03:01
The order of these "// namespace ..." comments is
vardhan
2016/07/29 21:29:22
oops, thanks!
|
| +} // namespace test |
| +} // namespace validation_util |
| + |
| +#endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_VALIDATION_UTIL_H_ |