Test harness for bytestodecimal
-------------------------------

These tests expect bytestodecimal.cpp to be compiled to a.out in the
current directory.

Two main tests are available:

1. mpzimportexporttest.sh

This bash script tests functionality on a variety of random data
(/dev/urandom), from zero to 100 metric megabytes.  The test will
abort if it input random data differs from a round trip (bytes ->
decimal -> bytes) output data.

The script tests the various input modes (bytestodecimal,
streamtodecimal with explicit buffer size, without buffer size), and
various combinations of leading NUL bytes, leading decimal zeroes or
whitespace.

The test calls mpzimportexporttestonefile.sh as a subroutine; it must
be present in the current directory.



2. mpzimportexporttestonemd5.sh

Test limited functionality (not testing as many modes or corner cases
as above) but allow testing on very large input without using as much
disk space as the previous test.

Rather than directly using /dev/urandom, the test generates
pseudorandom data using randdata4.  Compile with:

g++ -DNDEBUG -O2 -o randdata4 randdata4.cpp

Then, run mpzimportexporttestonemd5.sh under bash with an argument
indicating the number of metric megabytes of input.

Just for fun, the script converts the seed file (a small number of
bytes from /dev/urandom) to decimal and emits it as output, so a test
run could be exactly replicated if desired.


Copyright 2020 Ken Takusagawa

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
