GATSCompaniontorleProjectv2.1.0.pdf

GATS Page 1 – 3 G. Santor

GATS Companion to rle Project Author: Garth Santor Editors: n/a Version/Copyright: 2.1.0 (2021-03-08)

Overview Background about the rle/d project.

How to get started? Consider:

• Perform the simplest core feature first.

• Can I use read command-line arguments?

• What information do I need to collect?

• How do I store the information collected? Or in what do I store the information collected?

Things to watch for… 1. Files will have to be opened in binary mode so that none of the characters are converted (carriage return, ^D, ^Z could all be

changed)

2. If you want to convert a signed char to an unsigned integer, you’ll have to cast it to an unsigned char first!

Support Files The archives:

• rle.binaries.v2.0.0.zip (my demos + test program)

• rltest.datafiles.zip (the data files that rltest creates during its execution).

Use ‘rltest -v’ to see the full output of the test program comparison.

rltest rle trivial test

Command rle trivial.txt trivial.txt.rle

Description A single letter a

Input file a

Output file Characters with ASCII codes:

1 97

rle simple test Command rle simple.txt simple.txt.rle

Description A single repeated letter a

Input file aaaaaaaaaaaaa

Output file Characters with ASCII codes:

13 97

rle typical test Command rle typical.txt typical.txt.rle

GATS Page 2 – 3 G. Santor

Description A variety of different letters with different repeat counts.

Input file aaaaaaaaaaaaabbbcbccbbbed

Output file Characters with ASCII codes:

10 97 03 98 1 99 1 98 2 99 3 98 1 101 1 100

rle oneK test Command rle oneK.txt oneK.txt.rle

Description Test blocking. This is exactly 4 blocks of 255 letter a. 255 is the maximum block size.

Input file 1020 instances of letter ‘a’

Output file Characters with ASCII codes:

255 97 255 97 255 97 255 97

rle oneKone test Command rle oneKone.txt oneKone.txt.rle

Description Test blocking. This is exactly 4 blocks of 255, a one block of a single letter a. 255 is

the maximum block size.

Input file 1021 instances of letter ‘a’

Output file Characters with ASCII codes:

255 97 255 97 255 97 255 97 1 97

rld trivialcoded test Command rld trivial.txt.rle trivial.txt

Description A single repeated letter a

Input file Characters with ASCII codes:

1 97

Output file a

rld simplecoded test Command rld simplecoded.txt.rle simplecoded.txt

Description A single repeated letter a

Input file Characters with ASCII codes:

15 97

Output file aaaaaaaaaaaaaaa

rld typical test Command rld typicalcoded.txt.rle typicalcoded.txt

Description A variety of different letters with different repeat counts.

Input file Characters with ASCII codes:

10 97 2 88 1 55 1 56 3 45 7 44

Output file aaaaaaaaaaXXUVEEEDDDDDDD

rld oneK test Command rld oneKcoded.txt.rle oneKcoded.txt

Description Test blocking. This is exactly 4 blocks of 255 letter a. 255 is the maximum block size.

Input file Characters with ASCII codes:

255 97 255 97 255 97 255 97

Output file 1020 instances of the letter ‘a’

rld oneKone test Command rld oneKonecoded.txt.rle oneKonecoded.txt

Description Test blocking. This is exactly 4 blocks of 255, a one block of a single letter a. 255 is

the maximum block size.

Input file Characters with ASCII codes:

255 97 255 97 255 97 255 97 1 97

Output file 1021 instances of the letter ‘a’

GATS Page 3 – 3 G. Santor

rle default test Command rle default.txt

Description Test automatic extension creation.

Input file aaaaaaaaaaaaa

Output file File called “default.txt.rle”, characters with ASCII codes:

13 97

rld default test Command rld defaultcoded.txt.rle

Description Test if .rle extension is correctly removed for the output filename.

Input file Characters with ASCII codes:

10 97 2 88 1 55 1 56 3 45 7 44

Output file File called “defaultcoded.txt”, characters with ASCII codes:

aaaaaaaaaaXXUVEEEDDDDDDD

rle binary test Command rle binary.bin binary.bin.rle

Description Tests all of the

Input file All the ASCII character codes from 0 to 255

Output file Characters with ASCII codes:

1 0 1 1 1 2 1 3 1 4 1 5 …. 1 254 1 255

rld binary test Command rld binarycoded.bin.rle binarycoded.bin

Description A single repeated letter a

Input file Characters with ASCII codes:

1 0 1 1 1 2 1 3 1 4 1 5 …. 1 254 1 255

Output file All the ASCII character codes from 0 to 255

rle help test Command rle --help

Description Test the help output.

Input file n/a

Output file n/a

rld help test Command rld --help

Description Test the help output.

Input file n/a

Output file n/a

rle default test Command rle

Description No arguments should show the help.

Input file n/a

Output file n/a

rld default test Command rld

Description No arguments should show the help.

Input file n/a

Output file n/a