Use this sample test case as a guide line
This is a sample code for a simple test case. You should provide detailed test-cases to test each of the prototype functions similar to one shown below. These tests will be run against our model text buffer implementation and will also be run against some incorrect implementations of text buffer. If your test cases are written well, then your assertions against the incorrect implementations will fail and your program will gracefully exit.
// Blackbox testing - will test the functions in the prototype interface
// Test 1: Testing function linesTB()
// Pre: defined a valid string Post: return a new text buffer
TB tb1 = newTB("Lorem\nipsum\ndolor\nsit\namet\n");
assert(tb1 != NULL);
// Pre: tb is a valid text buffer Post: : Returns number of lines in text buffer
assert(linesTB(tb1) == 5);
Resource created Monday 12 December 2016, 06:10:40 PM, last modified Saturday 17 December 2016, 08:40:30 AM.