merge bitcoin#18126: Add fuzzing harness for locale independence testing

This commit is contained in:
Kittywhiskers Van Gogh 2020-02-11 15:25:51 +00:00
parent 38fd597f59
commit b28395f23b
3 changed files with 104 additions and 0 deletions

View File

@ -39,6 +39,7 @@ FUZZ_TARGETS = \
test/fuzz/inv_deserialize \ test/fuzz/inv_deserialize \
test/fuzz/key \ test/fuzz/key \
test/fuzz/key_origin_info_deserialize \ test/fuzz/key_origin_info_deserialize \
test/fuzz/locale \
test/fuzz/merkle_block_deserialize \ test/fuzz/merkle_block_deserialize \
test/fuzz/messageheader_deserialize \ test/fuzz/messageheader_deserialize \
test/fuzz/netaddr_deserialize \ test/fuzz/netaddr_deserialize \
@ -526,6 +527,12 @@ test_fuzz_key_origin_info_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
test_fuzz_key_origin_info_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(LDFLAGS_WRAP_EXCEPTIONS) test_fuzz_key_origin_info_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(LDFLAGS_WRAP_EXCEPTIONS)
test_fuzz_key_origin_info_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON) test_fuzz_key_origin_info_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
test_fuzz_locale_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
test_fuzz_locale_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
test_fuzz_locale_LDADD = $(FUZZ_SUITE_LD_COMMON)
test_fuzz_locale_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(LDFLAGS_WRAP_EXCEPTIONS)
test_fuzz_locale_SOURCES = $(FUZZ_SUITE) test/fuzz/locale.cpp
test_fuzz_merkle_block_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp test_fuzz_merkle_block_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
test_fuzz_merkle_block_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DMERKLE_BLOCK_DESERIALIZE=1 test_fuzz_merkle_block_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DMERKLE_BLOCK_DESERIALIZE=1
test_fuzz_merkle_block_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) test_fuzz_merkle_block_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

96
src/test/fuzz/locale.cpp Normal file

File diff suppressed because one or more lines are too long

View File

@ -28,6 +28,7 @@ KNOWN_VIOLATIONS=(
"src/test/blockchain_tests.cpp.*std::to_string" "src/test/blockchain_tests.cpp.*std::to_string"
"src/test/dbwrapper_tests.cpp:.*snprintf" "src/test/dbwrapper_tests.cpp:.*snprintf"
"src/test/denialofservice_tests.cpp.*std::to_string" "src/test/denialofservice_tests.cpp.*std::to_string"
"src/test/fuzz/locale.cpp"
"src/test/fuzz/parse_numbers.cpp:.*atoi" "src/test/fuzz/parse_numbers.cpp:.*atoi"
"src/test/key_tests.cpp.*std::to_string" "src/test/key_tests.cpp.*std::to_string"
"src/test/net_tests.cpp.*std::to_string" "src/test/net_tests.cpp.*std::to_string"