blob: 1eb7c25cfc6c9a93d3bb8b486ba231e8763e9c25 [file] [log] [blame]
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/ui/input/drivers/goldfish_sensor/parser.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
auto* char_data = reinterpret_cast<const char*>(data);
auto result = goldfish::sensor::ParseSensorReport(char_data, size);
bool expect_have_name = strnlen(char_data, size) > 0 && char_data[0] != ':';
bool actual_have_name = !result.name.empty();
return expect_have_name != actual_have_name;
}