OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_CERT_INTERNAL_TEST_HELPERS_H_ | 5 #ifndef NET_CERT_INTERNAL_TEST_HELPERS_H_ |
6 #define NET_CERT_INTERNAL_TEST_HELPERS_H_ | 6 #define NET_CERT_INTERNAL_TEST_HELPERS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <ostream> | 10 #include <ostream> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "net/der/input.h" | 14 #include "net/der/input.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace net { | 17 namespace net { |
18 | 18 |
19 namespace der { | 19 namespace der { |
20 | 20 |
21 // These functions are used by GTest to support EXPECT_EQ() for | 21 // These functions are used by GTest to support EXPECT_EQ() for |
22 // der::Input. | 22 // der::Input. |
23 void PrintTo(const Input& data, ::std::ostream* os); | 23 void PrintTo(const Input& data, ::std::ostream* os); |
24 bool operator==(const Input& a, const Input& b); | |
25 | 24 |
26 } // namespace der | 25 } // namespace der |
27 | 26 |
28 // Creates a der::Input from an std::string. The lifetimes are a bit subtle | 27 // Creates a der::Input from an std::string. The lifetimes are a bit subtle |
29 // when using this function: | 28 // when using this function: |
30 // | 29 // |
31 // The returned der::Input() is only valid so long as the input string is alive | 30 // The returned der::Input() is only valid so long as the input string is alive |
32 // and is not mutated. | 31 // and is not mutated. |
33 // | 32 // |
34 // Note that the input parameter has been made a pointer to prevent callers | 33 // Note that the input parameter has been made a pointer to prevent callers |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 template <size_t N> | 81 template <size_t N> |
83 ::testing::AssertionResult ReadTestDataFromPemFile( | 82 ::testing::AssertionResult ReadTestDataFromPemFile( |
84 const std::string& file_path_ascii, | 83 const std::string& file_path_ascii, |
85 const PemBlockMapping(&mappings)[N]) { | 84 const PemBlockMapping(&mappings)[N]) { |
86 return ReadTestDataFromPemFile(file_path_ascii, mappings, N); | 85 return ReadTestDataFromPemFile(file_path_ascii, mappings, N); |
87 } | 86 } |
88 | 87 |
89 } // namespace net | 88 } // namespace net |
90 | 89 |
91 #endif // NET_CERT_INTERNAL_TEST_HELPERS_H_ | 90 #endif // NET_CERT_INTERNAL_TEST_HELPERS_H_ |
OLD | NEW |