vendredi 6 février 2015

While loop inside unit testing framework

Looking at some macros of Qt Test Framework like QCOMPARE, this is the code:



#define QCOMPARE(actual, expected) \
do {\
if (!QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__))\
return;\
} while (0)


As you can see, there is a while loop. I found the same thing inside CryEngine Unit Testing framework too. My question is simple: is there any reason to use that loop or maybe is something left there from an old implementation?


Aucun commentaire:

Enregistrer un commentaire