OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "net/spdy/fuzzing/hpack_fuzz_util.h" | 5 #include "net/spdy/fuzzing/hpack_fuzz_util.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 EXPECT_TRUE(HpackFuzzUtil::RunHeaderBlockThroughFuzzerStages( | 133 EXPECT_TRUE(HpackFuzzUtil::RunHeaderBlockThroughFuzzerStages( |
134 &context, block)); | 134 &context, block)); |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 TEST(HpackFuzzUtilTest, FlipBitsMutatesBuffer) { | 138 TEST(HpackFuzzUtilTest, FlipBitsMutatesBuffer) { |
139 char buffer[] = "testbuffer1234567890"; | 139 char buffer[] = "testbuffer1234567890"; |
140 string unmodified(buffer, arraysize(buffer) - 1); | 140 string unmodified(buffer, arraysize(buffer) - 1); |
141 | 141 |
142 EXPECT_EQ(unmodified, buffer); | 142 EXPECT_EQ(unmodified, buffer); |
143 HpackFuzzUtil::FlipBits(reinterpret_cast<uint8*>(buffer), | 143 HpackFuzzUtil::FlipBits(reinterpret_cast<uint8_t*>(buffer), |
144 arraysize(buffer) - 1, | 144 arraysize(buffer) - 1, 1); |
145 1); | |
146 EXPECT_NE(unmodified, buffer); | 145 EXPECT_NE(unmodified, buffer); |
147 } | 146 } |
148 | 147 |
149 } // namespace test | 148 } // namespace test |
150 } // namespace net | 149 } // namespace net |
OLD | NEW |