COMP 2012H Honors Object-Oriented Programming and Data Structures

Assignment 2 Database System for Stock

Sample Test Cases


We provide test cases for each task of this assignment.

Download the header file and the source file (last update: 14:00, Oct 12)

For each taskx() function, the testing will continue only if the previous test case is passed. If

  • the whole program crash, you may need to check how you deal with the pointers.
  • you see "wrong answer", the values of the variables are not as expected.
  • you see "Task x pass", you pass all the test cases of this task.
Since we cannot isolate the testing for each function, you are expected to complete the whole task before testing it.


Check Memory Leak


You can use Dr. Memory or Valgrind to check memory leak. You need to disable compiler optimization (-O0).


Dr. Memory (For Windows, Mac and Linux)

$ X:\path\to\drmemory\bin64\drmemory.exe X:\path\to\your\executable.exe

* You can ignore "UNINITIALIZED READ: reading register eax" errors.
* Some of the leak problems cannot be detected if your compiler is VS.
* If you are using Windows, download this and put it at X:\path\to\drmemory\bin


Valgrind (For Mac and Linux)

$ valgrind --tool=memcheck --leak-check=full path/to/your/executable

* Valgrind doesn't support Windows.

Page maintained by
Homepage