From 120ed0272569e6a34172a511d4a5a70a3a18f1d2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 11 Oct 2018 17:08:12 -0400 Subject: [PATCH] [fuzzing] Fold get-codepoints-fuzzer into subset-fuzzer --- test/fuzzing/Makefile.am | 16 ------------- test/fuzzing/hb-subset-fuzzer.cc | 5 ++++ .../hb-subset-get-codepoints-fuzzer.cc | 23 ------------------- 3 files changed, 5 insertions(+), 39 deletions(-) delete mode 100644 test/fuzzing/hb-subset-get-codepoints-fuzzer.cc diff --git a/test/fuzzing/Makefile.am b/test/fuzzing/Makefile.am index 5af5a733..a57f41dc 100644 --- a/test/fuzzing/Makefile.am +++ b/test/fuzzing/Makefile.am @@ -23,7 +23,6 @@ EXTRA_DIST += \ check_PROGRAMS = \ hb-shape-fuzzer \ hb-subset-fuzzer \ - hb-subset-get-codepoints-fuzzer \ $(NULL) AM_CPPFLAGS = \ @@ -65,21 +64,6 @@ hb_subset_fuzzer_DEPENDENCIES = \ lib \ $(NULL) -hb_subset_get_codepoints_fuzzer_SOURCES = \ - hb-fuzzer.hh \ - hb-subset-get-codepoints-fuzzer.cc \ - main.cc \ - $(NULL) -hb_subset_get_codepoints_fuzzer_LDADD = \ - $(top_builddir)/src/libharfbuzz-subset-fuzzing.la \ - $(NULL) -hb_subset_get_codepoints_fuzzer_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(NULL) -hb_subset_get_codepoints_fuzzer_DEPENDENCIES = \ - lib \ - $(NULL) - check: EXEEXT="$(EXEEXT)" srcdir="$(srcdir)" builddir="$(builddir)" $(srcdir)/run-shape-fuzzer-tests.py EXEEXT="$(EXEEXT)" srcdir="$(srcdir)" builddir="$(builddir)" $(srcdir)/run-subset-fuzzer-tests.py diff --git a/test/fuzzing/hb-subset-fuzzer.cc b/test/fuzzing/hb-subset-fuzzer.cc index 649722ce..3a71f221 100644 --- a/test/fuzzing/hb-subset-fuzzer.cc +++ b/test/fuzzing/hb-subset-fuzzer.cc @@ -50,6 +50,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) HB_MEMORY_MODE_READONLY, NULL, NULL); hb_face_t *face = hb_face_create (blob, 0); + /* Just test this API here quickly. */ + hb_set_t *output = hb_set_create(); + hb_face_collect_unicodes (face, output); + hb_set_destroy (output); + const hb_codepoint_t text[] = { 'A', 'B', 'C', 'D', 'E', 'X', 'Y', 'Z', '1', '2', diff --git a/test/fuzzing/hb-subset-get-codepoints-fuzzer.cc b/test/fuzzing/hb-subset-get-codepoints-fuzzer.cc deleted file mode 100644 index 3d43627b..00000000 --- a/test/fuzzing/hb-subset-get-codepoints-fuzzer.cc +++ /dev/null @@ -1,23 +0,0 @@ -#include "hb-fuzzer.hh" - -#include -#include -#include - -#include "hb-subset.h" - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - hb_blob_t *blob = hb_blob_create ((const char *)data, size, - HB_MEMORY_MODE_READONLY, NULL, NULL); - hb_face_t *face = hb_face_create (blob, 0); - - hb_set_t *output = hb_set_create(); - hb_face_collect_unicodes (face, output); - - hb_set_destroy (output); - hb_face_destroy (face); - hb_blob_destroy (blob); - - return 0; -} -- GitLab