Skip to content
This repository has been archived by the owner on Aug 5, 2019. It is now read-only.

tommyang/CSE100_Huffman_Tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

CSE100 Huffman Tester

UCSD CSE100 Fall 2016 PA3 Self-Tester for Students.

WARNING: THIS SCRIPT IS PROVIDED WITHOUT ANY GUARANTEE. IT IS YOUR RESPONSIBILITY TO MAKE SURE YOUR CODE WORKS CORRECTLY.

Before you use it, please read the script and make sure you understand what it is doing. I have written many comments so that the script is more understandable.

Being able to write these scripts is a skill that we expect you to develop and will make you a much stronger programmer.

The tester assumes you have the following PA directory sturcture:

.
|-- BitInputStream.cpp
|-- BitInputStream.hpp
|-- BitOutputStream.cpp
|-- BitOutputStream.hpp
|-- HCNode.cpp
|-- HCNode.hpp
|-- HCTree.cpp
|-- HCTree.hpp
|-- Makefile
|-- compress.cpp
|-- ty_tester.sh
|-- pa3_input_files
|   `-- (the input files used for testing)
|-- refcompress
|-- refuncompress
`-- uncompress.cpp

What does the tester do?

  1. The tester use make to compile your code;
  • The tester will exit if make fails.
  1. It generates a random binary input file and a random text input file for testing using openssl rand;
  • The two files will be 5 MiB in size to keep the running time reasonable;
  1. The tester will loop through all the input files found in pa3_input_files to test them;
  • Accuracy Test: For each file, the tester will perform a compress and uncompress and compare the result with the original file;
    • The tester will exit if an accuracy test fails.
  • Compression Ratio Test: If you pass in -r flag, the tester will also perform a refcompress and compare the sizes of compressed versions to make sure your version beats the reference version in compression ratio.
    • The tester will continue even if a compression ratio test fails.
  1. Temporary files generated by the tester will be deleted upon exit.

How to use

  1. Download the script and place it in the correct location (see above).
  2. Read the script and make sure you understand what it is doing. Being able to write these scripts is a skill that we expect you to develop and will make you a much stronger programmer.
  3. Usage information is described in detail inside the script.

Good luck on this PA!

Credit

This was originally written and used by me a few quarters ago. I made some changes that are inspired by Raymond's script from the Winter 2016 quarter.

About

UCSD CSE100 Huffman Self-Tester for Students.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages