Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2054b0e5 authored by Zach Johnson's avatar Zach Johnson
Browse files

Format gd/fuzz with new clang-format

find fuzz -regex '.*\.\(cc\|h\|tpp\)' -exec clang-format -style=file -i {} \;

Test: cert/run --host
Bug: 156858180
Tag: #gd-refactor
Change-Id: I2dfe844b7deb2b82ec482eed0a0a491ee45c1fb7
parent 662604ce
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -15,14 +15,15 @@
 */

#include "fuzz/helpers.h"

#include "common/bind.h"

namespace bluetooth {
namespace fuzz {

// cribbed from https://github.com/google/fuzzing/blob/master/docs/split-inputs.md#magic-separator
std::vector<std::vector<uint8_t>> SplitInput(const uint8_t* data, size_t size, const uint8_t* separator,
                                             size_t separatorSize) {
std::vector<std::vector<uint8_t>> SplitInput(
    const uint8_t* data, size_t size, const uint8_t* separator, size_t separatorSize) {
  std::vector<std::vector<uint8_t>> result;
  assert(SeparatorSize > 0);
  auto beg = data;
+5 −4
Original line number Diff line number Diff line
@@ -16,17 +16,18 @@

#pragma once

#include <fuzzer/FuzzedDataProvider.h>

#include <cstdint>
#include <vector>
#include "os/handler.h"

#include <fuzzer/FuzzedDataProvider.h>
#include "os/handler.h"

namespace bluetooth {
namespace fuzz {

std::vector<std::vector<uint8_t>> SplitInput(const uint8_t* data, size_t size, const uint8_t* separator,
                                             size_t separatorSize);
std::vector<std::vector<uint8_t>> SplitInput(
    const uint8_t* data, size_t size, const uint8_t* separator, size_t separatorSize);

std::vector<uint8_t> GetArbitraryBytes(FuzzedDataProvider* fdp);