Closed MrHerbs closed 8 years ago
Extract from given ccListTest.cpp
:
CircularList<int> cclist1;
// Add elements to cclist1
CircularList<int>* cclist2 = new CircularList<int>(cclist1);
cclist1 = *cclist2;
Related Black Fitch test case:
TEST_CASE("testing CircularList<int> assignment operator", "[task2]") {
CircularList<int> *ll1 = new CircularList<int>();
ll1->insert(0, 1);
ll1->insert(1, 2);
ll1->insert(2, 3);
CircularList<int> *ll2 = new CircularList<int>();
ll2->insert(0, 9);
ll2 = ll1;
ostringstream result;
result << "[1,2,3]";
ostringstream output;
captureDisplay(ll2, output);
REQUIRE(output.str() == result.str());
REQUIRE(testTailPointsToHead(ll2) == true);
}
ll2 = ll1;
should be `ll2 = ll1', otherwise we are simply assigning one pointer value to another.
I will fix and send a pull request.
Fitchfork: