blob: 9c98da7eb312d9ae64443a8c23fcb472cc85ca95 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
For this assignment, you will be writing testcases for
your next assignment (as usual, the instructions for that assignment
can be found in next-README).
As usual, one correct and many broken implementations can be found
in /usr/local/l2p/subseq.
As with power, these are provided as compiled object files, and you
should write a C program (in test-subseq.c) whose main function tests
the maxSeq function. As before, it should exit with EXIT_SUCCESS if all
tests pass, and EXIT_FAILURE if any test fails. Note that you will
need to write the prototype for maxSeq:
size_t maxSeq(int * array, size_t n);
in your test-subseq.c file, so that the compiler knows about the
maxSeq function. The correct place to put it is after you #include
any .h files you need, but before any other code you write.
We have provided run_all.sh to help you run your test cases against
all implementations.
HINT: Think about how can you can vary not just the values in your array
but the size as well. What about how the values change over time?
|