Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: net/cert/internal/test_helpers.h

Issue 1664243002: Using == instead of Equals for der::Input comparison. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using non-class equality. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
eroman 2016/02/04 19:43:42 These functions --> This function is used...
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 // Parses |s| as a DER SEQUENCE TLV and returns a der::Input corresponding to 27 // Parses |s| as a DER SEQUENCE TLV and returns a der::Input corresponding to
29 // the value portion. On error returns an empty der::Input and adds a gtest 28 // the value portion. On error returns an empty der::Input and adds a gtest
30 // failure. 29 // failure.
31 // 30 //
32 // The returned der::Input() is only valid so long as the input string is alive 31 // The returned der::Input() is only valid so long as the input string is alive
33 // and is not mutated. 32 // and is not mutated.
34 der::Input SequenceValueFromString(const std::string* s); 33 der::Input SequenceValueFromString(const std::string* s);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 template <size_t N> 71 template <size_t N>
73 ::testing::AssertionResult ReadTestDataFromPemFile( 72 ::testing::AssertionResult ReadTestDataFromPemFile(
74 const std::string& file_path_ascii, 73 const std::string& file_path_ascii,
75 const PemBlockMapping(&mappings)[N]) { 74 const PemBlockMapping(&mappings)[N]) {
76 return ReadTestDataFromPemFile(file_path_ascii, mappings, N); 75 return ReadTestDataFromPemFile(file_path_ascii, mappings, N);
77 } 76 }
78 77
79 } // namespace net 78 } // namespace net
80 79
81 #endif // NET_CERT_INTERNAL_TEST_HELPERS_H_ 80 #endif // NET_CERT_INTERNAL_TEST_HELPERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698