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

Side by Side Diff: testing/libfuzzer/fuzzers/courgette_fuzzer.cc

Issue 1855823002: convert //testing to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | testing/libfuzzer/fuzzers/es_parser_mpeg1audio_fuzzer.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 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 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include <memory>
9
9 #include "courgette/assembly_program.h" 10 #include "courgette/assembly_program.h"
10 #include "courgette/courgette.h" 11 #include "courgette/courgette.h"
11 #include "courgette/encoded_program.h" 12 #include "courgette/encoded_program.h"
12 #include "courgette/program_detector.h" 13 #include "courgette/program_detector.h"
13 14
14 // Entry point for LibFuzzer. 15 // Entry point for LibFuzzer.
15 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 16 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
16 scoped_ptr<courgette::AssemblyProgram> prog; 17 std::unique_ptr<courgette::AssemblyProgram> prog;
17 courgette::Status status = 18 courgette::Status status =
18 courgette::ParseDetectedExecutable(data, size, &prog); 19 courgette::ParseDetectedExecutable(data, size, &prog);
19 if (status != courgette::C_OK) { 20 if (status != courgette::C_OK) {
20 return 0; 21 return 0;
21 } 22 }
22 scoped_ptr<courgette::EncodedProgram> enc_prog(prog->Encode()); 23 std::unique_ptr<courgette::EncodedProgram> enc_prog(prog->Encode());
23 return 0; 24 return 0;
24 } 25 }
OLDNEW
« no previous file with comments | « no previous file | testing/libfuzzer/fuzzers/es_parser_mpeg1audio_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698