diff --git a/test/fuzzing/test_fuzzing_add.cpp b/test/fuzzing/test_fuzzing_add.cpp index b2d11e1..fae8700 100644 --- a/test/fuzzing/test_fuzzing_add.cpp +++ b/test/fuzzing/test_fuzzing_add.cpp @@ -6,7 +6,7 @@ // // cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer -// clang++ -g -O2 -fsanitize=fuzzer,address,undefined -I. -I/mnt/c/boost/boost_1_85_0 test/fuzzing/test_fuzzing_add.cpp -o test_fuzzing_add +// clang++ -std=c++20 -g -O2 -fsanitize=fuzzer,address,undefined -I. -I/mnt/c/boost/boost_1_85_0 test/fuzzing/test_fuzzing_add.cpp -o test_fuzzing_add // ./test_fuzzing_add -max_total_time=180 #include @@ -49,11 +49,11 @@ auto fuzzing::eval_add(const std::uint8_t* data, std::size_t size) -> bool if((size > std::size_t { UINT8_C(1) }) && (size <= std::size_t { max_size * 2U })) { - local_uint_type a_local { }; - local_uint_type b_local { }; + local_uint_type a_local { 0U }; + local_uint_type b_local { 0U }; - boost_uint_type a_boost { }; - boost_uint_type b_boost { }; + boost_uint_type a_boost { 0U }; + boost_uint_type b_boost { 0U }; // Import data into their respective uintwide_t a and b values. import_bits diff --git a/test/fuzzing/test_fuzzing_div.cpp b/test/fuzzing/test_fuzzing_div.cpp index 85c497c..fa4bda2 100644 --- a/test/fuzzing/test_fuzzing_div.cpp +++ b/test/fuzzing/test_fuzzing_div.cpp @@ -6,7 +6,7 @@ // // cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer -// clang++ -g -O2 -fsanitize=fuzzer,address,undefined -I. -I/mnt/c/boost/boost_1_85_0 test/fuzzing/test_fuzzing_div.cpp -o test_fuzzing_div +// clang++ -std=c++20 -g -O2 -fsanitize=fuzzer,address,undefined -I. -I/mnt/c/boost/boost_1_85_0 test/fuzzing/test_fuzzing_div.cpp -o test_fuzzing_div // ./test_fuzzing_div -max_total_time=180 #include @@ -49,11 +49,11 @@ auto fuzzing::eval_div(const std::uint8_t* data, std::size_t size) -> bool if((size > std::size_t { UINT8_C(1) }) && (size <= std::size_t { max_size * 2U })) { - local_uint_type a_local { }; - local_uint_type b_local { }; + local_uint_type a_local { 0U }; + local_uint_type b_local { 0U }; - boost_uint_type a_boost { }; - boost_uint_type b_boost { }; + boost_uint_type a_boost { 0U }; + boost_uint_type b_boost { 0U }; // Import data into their respective uintwide_t a and b values. import_bits diff --git a/test/fuzzing/test_fuzzing_mul.cpp b/test/fuzzing/test_fuzzing_mul.cpp index eb0b6fc..870d82d 100644 --- a/test/fuzzing/test_fuzzing_mul.cpp +++ b/test/fuzzing/test_fuzzing_mul.cpp @@ -6,7 +6,7 @@ // // cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer -// clang++ -g -O2 -fsanitize=fuzzer,address,undefined -I. -I/mnt/c/boost/boost_1_85_0 test/fuzzing/test_fuzzing_mul.cpp -o test_fuzzing_mul +// clang++ -std=c++20 -g -O2 -fsanitize=fuzzer,address,undefined -I. -I/mnt/c/boost/boost_1_85_0 test/fuzzing/test_fuzzing_mul.cpp -o test_fuzzing_mul // ./test_fuzzing_mul -max_total_time=180 #include @@ -49,11 +49,11 @@ auto fuzzing::eval_mul(const std::uint8_t* data, std::size_t size) -> bool if((size > std::size_t { UINT8_C(1) }) && (size <= std::size_t { max_size * 2U })) { - local_uint_type a_local { }; - local_uint_type b_local { }; + local_uint_type a_local { 0U }; + local_uint_type b_local { 0U }; - boost_uint_type a_boost { }; - boost_uint_type b_boost { }; + boost_uint_type a_boost { 0U }; + boost_uint_type b_boost { 0U }; // Import data into their respective uintwide_t a and b values. import_bits diff --git a/test/fuzzing/test_fuzzing_prime.cpp b/test/fuzzing/test_fuzzing_prime.cpp index 5d4a1b4..fd3ff36 100644 --- a/test/fuzzing/test_fuzzing_prime.cpp +++ b/test/fuzzing/test_fuzzing_prime.cpp @@ -6,7 +6,7 @@ // // cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer -// clang++ -g -O2 -fsanitize=fuzzer,address,undefined -I. -I/mnt/c/boost/boost_1_85_0 test/fuzzing/test_fuzzing_prime.cpp -o test_fuzzing_prime +// clang++ -std=c++20 -g -O2 -fsanitize=fuzzer,address,undefined -I. -I/mnt/c/boost/boost_1_85_0 test/fuzzing/test_fuzzing_prime.cpp -o test_fuzzing_prime // ./test_fuzzing_prime -max_total_time=180 #include @@ -64,32 +64,30 @@ auto fuzzing::eval_prime(const std::uint8_t* data, std::size_t size) -> bool distribution_type distribution1; distribution_type distribution2; - local_uint_type p0 { }; + local_uint_type p0 { 0U }; // Import the random data into the prime candidate. import_bits ( p0, data, - data + size, - 8U + data + size ); const bool miller_rabin_result_local { miller_rabin(p0, 25U, distribution2, generator2) }; - const boost_uint_type - pb + auto from_string = + [](const local_uint_type& ui) { - [&p0]() - { - std::stringstream strm { }; + std::stringstream strm { }; - strm << p0; + strm << ui; - return strm.str(); - }() + return boost_uint_type { strm.str() }; }; + const boost_uint_type pb { std::move(from_string(p0)) }; + // Ensure that both uintwide_t as well as boost obtain // the same prime (or non-prime) result. diff --git a/test/fuzzing/test_fuzzing_sub.cpp b/test/fuzzing/test_fuzzing_sub.cpp index d57574d..9190339 100644 --- a/test/fuzzing/test_fuzzing_sub.cpp +++ b/test/fuzzing/test_fuzzing_sub.cpp @@ -6,7 +6,7 @@ // // cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer -// clang++ -g -O2 -fsanitize=fuzzer,address,undefined -I. -I/mnt/c/boost/boost_1_85_0 test/fuzzing/test_fuzzing_sub.cpp -o test_fuzzing_sub +// clang++ -std=c++20 -g -O2 -fsanitize=fuzzer,address,undefined -I. -I/mnt/c/boost/boost_1_85_0 test/fuzzing/test_fuzzing_sub.cpp -o test_fuzzing_sub // ./test_fuzzing_sub -max_total_time=180 #include @@ -49,11 +49,11 @@ auto fuzzing::eval_sub(const std::uint8_t* data, std::size_t size) -> bool if((size > std::size_t { UINT8_C(1) }) && (size <= std::size_t { max_size * 2U })) { - local_uint_type a_local { }; - local_uint_type b_local { }; + local_uint_type a_local { 0U }; + local_uint_type b_local { 0U }; - boost_uint_type a_boost { }; - boost_uint_type b_boost { }; + boost_uint_type a_boost { 0U }; + boost_uint_type b_boost { 0U }; // Import data into their respective uintwide_t a and b values. import_bits