OLD | NEW |
| (Empty) |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // This file contains utility functions for reading and parsing validation data | |
6 // files. | |
7 | |
8 #ifndef MOJO_PUBLIC_CPP_BINDINGS_TESTS_VALIDATION_UTIL_H_ | |
9 #define MOJO_PUBLIC_CPP_BINDINGS_TESTS_VALIDATION_UTIL_H_ | |
10 | |
11 #include <stddef.h> | |
12 #include <stdint.h> | |
13 | |
14 #include <string> | |
15 #include <vector> | |
16 | |
17 namespace mojo { | |
18 namespace test { | |
19 namespace validation_util { | |
20 | |
21 // Given |test_name|, which is the filename of a test file (excluding the | |
22 // extension), reads in and parses the binary test data (stored in |data|), the | |
23 // number of expected handles (stored in |num_handles|), and the expected | |
24 // validation string (stored in |expected|). | |
25 bool ReadTestCase(const std::string& test_name, | |
26 std::vector<uint8_t>* data, | |
27 size_t* num_handles, | |
28 std::string* expected); | |
29 | |
30 // Gets a list of matching tests with prefix |prefix|; these list of tests are | |
31 // file names of the tests, without the '.data' extension. | |
32 std::vector<std::string> GetMatchingTests(const std::string& prefix); | |
33 | |
34 } // namespace validation_util | |
35 } // namespace test | |
36 } // namespace mojo | |
37 | |
38 #endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_VALIDATION_UTIL_H_ | |
OLD | NEW |