Closed egeldenhuys closed 7 years ago
If you add a demo test so I can see the format again, I'll add my Task 1 tests.
@devosray, I created a rough framework for how the tests will be structured for task1 using the Catch framework.
Try branching from cos212-a1
then opening a pull request with your tests.
Should 0
be included in the range of allowed values?
This is very confusing. The wording used in the practical is "positive integer". According to multiple sources, positive integers in mathematics are "Numbers greater than 0 that can be expressed without a fraction."
However, unsigned integers in C++ can be 0. WHO KNOWS :frowning_face:
For now I will assume that 0
is a valid element.
I implemented my tests for CircularList.C
.
@devosray Can you please run it against your code and give feedback?
It seems like the configure script does not add CircularList.C
to the project source and thus never gets compiled. I will submit a pull request shortly.
Except from that, all tests seems fine. A few fail because in my code I have assumed that 0 is not a positive integer.
EDIT: See #47
Sorry, I forgot to apply the changes to the makefile template. I will push the working template some time today
Thank you for testing!
Added tests for the Stack class. They are derived from the same tests for CircularList, so if any cases are not covered in there they will not be covered in tests_Stack.cpp
Note: Still need to add tests for isEmpty()
I have uploaded my attempt and got full marks while assuming that 0 is not a positive integer
@devosray I will adapt the tests accordingly
If a Stack object is printed and contains the elements 5,4,3 and 2, with 5 being the top element and 2 the bottom, the output MUST be in the following format: [5,4,3,2]
however in my implementation the top of the Stack is at the end. @devosray Did you fail any tests regarding your Stack structure?
@egeldenhuys It seems like all your stack tests are failing with my implementation. I think you got the order the wrong way, because most of the failed cases looks like this:
REQUIRE( getOutput(listA) == "[1,2,3,4]" ) with expansion: "[4,3,2,1]" == "[1,2,3,4]"
I believe the top of the stack can be seen as the front of the CircularList.
I will modify the tests so that the Top of the stack is at the front.
Requesting review for Task 1. @devosray @Quantum-Sicarius @Paulo-W @RagingGrim
21/21 For Task1.
@egeldenhuys Except for 3 tests that still include 0, the C++ part (task 1) seems fine. 21/21
I got 17/21 and 16/21 ( go figure ) but I assume I have a memory leak in my code or some obscure condition I did not take into account.
I will email you an archive with all of my code.
On another note , why not have your makefile cd to the directory the client's code is in.
I'd much rather do
make CD=~/mycode/myprac
Than
make -f blackfitch-makefile
It might be more typing but at least I'm not copying the same file to different directories :dagger: It also might be possible to implement both of these as options by having the CD variable be set to empty as default.
How do I use this to test my Task 1 code?
@mameen-omar
git clone https://github.com/egeldenhuys/black-fitch.git
cos212-a1
branch
cd black-fitch
git checkout cos212-a1
cd cos212_assignment1
./configure
black-fitch-makefile
to your Task1 source directorycd /path/to/task1
make -f black-fitch-makefile task1
I am now finished with the tests for Assignment 1. Recieved 21/21 for both tasks and passing all Black Fitch tests.
For testing Task2:
make -f black-fitch-makefile pull
make -f black-fitch-makefile task2
Please review Task2: @RagingGrim @devosray @Quantum-Sicarius @Paulo-W
Edit: Will update make file branch and merge into master once two other people have reviewed Task 2.
Task1: 100% Task2: 100%
I believe it is ready to be merged. @egeldenhuys Well done and thank you!
Discussion thread for COS 212 Assignment 1
The unit tests need to be reviewed/run by at least two other people before merging into master.
TODO
0
from valid resultsAssumptions
0
is a NOT a valid element[]
Progress