mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-01 00:28:18 +00:00
test/fuzz: hfp at parser
This commit is contained in:
parent
eed67a37be
commit
941838bd23
13
test/fuzz/.gitignore
vendored
13
test/fuzz/.gitignore
vendored
@ -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
|
||||
|
20
test/fuzz/fuzz_hfp_at_parser.c
Normal file
20
test/fuzz/fuzz_hfp_at_parser.c
Normal 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
11
test/hfp/.gitignore
vendored
@ -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/*
|
||||
|
Loading…
Reference in New Issue
Block a user