test/fuzz: hfp at parser

This commit is contained in:
Milanka Ringwald 2020-06-19 14:51:32 +02:00
parent eed67a37be
commit 941838bd23
3 changed files with 33 additions and 11 deletions

13
test/fuzz/.gitignore vendored
View File

@ -1,14 +1,15 @@
build
cmake-build-debug
cmake_install.cmake
CMakeCache.txt
CMakeFiles
crash-*
default.profraw
build
Makefile
cmake-build-debug
cmake_install.cmake
fuzz_hci
fuzz_hci_transport_h4
fuzz_ad_parser
fuzz_att_db
fuzz_gatt_client
fuzz_hci
fuzz_hci_transport_h4
fuzz_hfp_at_parser
libbtstack.a
Makefile

View File

@ -0,0 +1,20 @@
#include <stdint.h>
#include <stddef.h>
#include "classic/hfp.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
// test ad iterator by calling simple function that uses it
if (size < 1) return 0;
int is_handsfree = data[0] & 1;
hfp_connection_t hfp_connection;
memset(&hfp_connection, 0, sizeof(hfp_connection_t));
uint32_t i;
for (i = 1; i < size; i++){
hfp_parse(&hfp_connection, data[i], is_handsfree);
}
return 0;
}

11
test/hfp/.gitignore vendored
View File

@ -1,7 +1,8 @@
hfp_hf_client_test
hfp_ag_client_test
hfp_hf_parser_test
hfp_ag_parser_test
cvsd_plc_test
results/*
hfp_ag_client_test
hfp_ag_parser_test
hfp_at_parser_test
hfp_hf_client_test
hfp_hf_parser_test
pklg_cvsd_test
results/*