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 8 years ago, last modified 8 years ago.