Bug #134

false positive on already registered test

Added by Lukas Felber almost 4 years ago.

Status:NewStart date:06 Nov 2013
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

tdd still proposes to add operator() to the test suite even if it is already registered there.

#include "cute.h" 
#include "ide_listener.h" 
#include "xml_listener.h" 
#include "cute_runner.h" 

void thisIsATest() {
    ASSERTM("start writing tests", false);
}

class myclassTest {
public:
    myclassTest(int i) {
    }
    void operator()() {
        ASSERTM("start writing tests", true);
    }
};

void runAllTests(int argc, char const *argv[]) {
    cute::suite s;
    //TODO add your test here
    s.push_back(CUTE(thisIsATest));
    s.push_back(myclassTest(1));
    cute::xml_file_opener xmlfile(argc, argv);
    cute::xml_listener<cute::ide_listener<> > lis(xmlfile.out);
    cute::makeRunner(lis, argc, argv)(s, "AllTests");
}

int main(int argc, char const *argv[]) {
    runAllTests(argc, argv);
    return 0;
}

Also available in: Atom PDF