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

Side by Side Diff: courgette/encoded_program_fuzz_unittest.cc

Issue 1543643002: Switch to standard integer types in courgette/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 12 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
« no previous file with comments | « courgette/encoded_program.cc ('k') | courgette/encoded_program_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Fuzz testing for EncodedProgram serialized format and assembly. 5 // Fuzz testing for EncodedProgram serialized format and assembly.
6 // 6 //
7 // We would like some assurance that if an EncodedProgram is malformed we will 7 // We would like some assurance that if an EncodedProgram is malformed we will
8 // not crash. The EncodedProgram could be malformed either due to malicious 8 // not crash. The EncodedProgram could be malformed either due to malicious
9 // attack to due to an error in patch generation. 9 // attack to due to an error in patch generation.
10 // 10 //
11 // We try a lot of arbitrary modifications to the serialized form and make sure 11 // We try a lot of arbitrary modifications to the serialized form and make sure
12 // that the outcome is not a crash. 12 // that the outcome is not a crash.
13 13
14 #include "base/test/test_suite.h" 14 #include "base/test/test_suite.h"
15 15
16 #include <stddef.h>
17
16 #include "courgette/base_test_unittest.h" 18 #include "courgette/base_test_unittest.h"
17 #include "courgette/courgette.h" 19 #include "courgette/courgette.h"
18 #include "courgette/streams.h" 20 #include "courgette/streams.h"
19 21
20 class DecodeFuzzTest : public BaseTest { 22 class DecodeFuzzTest : public BaseTest {
21 public: 23 public:
22 void FuzzExe(const char *) const; 24 void FuzzExe(const char *) const;
23 25
24 private: 26 private:
25 void FuzzByte(const std::string& buffer, const std::string& output, 27 void FuzzByte(const std::string& buffer, const std::string& output,
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 } 200 }
199 201
200 TEST_F(DecodeFuzzTest, All) { 202 TEST_F(DecodeFuzzTest, All) {
201 FuzzExe("setup1.exe"); 203 FuzzExe("setup1.exe");
202 FuzzExe("elf-32-1.exe"); 204 FuzzExe("elf-32-1.exe");
203 } 205 }
204 206
205 int main(int argc, char** argv) { 207 int main(int argc, char** argv) {
206 return base::TestSuite(argc, argv).Run(); 208 return base::TestSuite(argc, argv).Run();
207 } 209 }
OLDNEW
« no previous file with comments | « courgette/encoded_program.cc ('k') | courgette/encoded_program_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698