Add fuzzer for the terminal
This commit adds a fuzzer for more of the terminal pipeline, adding coverage for the input and output portions of the terminal framebuffer.
This commit is contained in:
committed by
Alex Chernyakhovsky
parent
0c6e034459
commit
adb62e97ff
@@ -1,7 +1,11 @@
|
|||||||
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS) $(FUZZING_CFLAGS)
|
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS) $(FUZZING_CFLAGS)
|
||||||
|
|
||||||
noinst_PROGRAMS = terminal_parser_fuzzer
|
noinst_PROGRAMS = terminal_parser_fuzzer terminal_fuzzer
|
||||||
|
|
||||||
terminal_parser_fuzzer_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util
|
terminal_parser_fuzzer_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util
|
||||||
terminal_parser_fuzzer_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a
|
terminal_parser_fuzzer_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a
|
||||||
terminal_parser_fuzzer_SOURCES = terminal_parser_fuzzer.cc
|
terminal_parser_fuzzer_SOURCES = terminal_parser_fuzzer.cc
|
||||||
|
|
||||||
|
terminal_fuzzer_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util -I$(srcdir)/../statesync -I../protobufs
|
||||||
|
terminal_fuzzer_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a ../statesync/libmoshstatesync.a ../protobufs/libmoshprotos.a $(TINFO_LIBS) $(protobuf_LIBS)
|
||||||
|
terminal_fuzzer_SOURCES = terminal_fuzzer.cc
|
||||||
|
|||||||
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
.
|
||||||
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
&�����:#
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
&
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
@
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
@
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
@
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
�
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#include <cstddef>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
#include "parser.h"
|
||||||
|
#include "completeterminal.h"
|
||||||
|
|
||||||
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||||
|
Terminal::Display display(false);
|
||||||
|
Terminal::Complete complete(80, 24);
|
||||||
|
Terminal::Framebuffer state(80, 24);
|
||||||
|
for (size_t i = 0; i < size; i++) {
|
||||||
|
complete.act(Parser::UserByte(data[i]));
|
||||||
|
}
|
||||||
|
display.new_frame(true, state, complete.get_fb());
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user