Fix START_LOOP, ASSERT_NEGATIVE_TESTCASES and ASSERT_POSITIVE_TESTCASES to test all items

This commit is contained in:
Rudy Huyn 2019-03-11 20:14:46 -07:00
commit 080e96c557

View file

@ -26,7 +26,7 @@ namespace CalculatorUnitTests
#define ASSERT_POSITIVE_TESTCASES(func, dataSet) \ #define ASSERT_POSITIVE_TESTCASES(func, dataSet) \
{\ {\
int size = sizeof(dataSet)/sizeof(*dataSet);\ int size = sizeof(dataSet)/sizeof(*dataSet);\
while(--size)\ while(--size >= 0)\
{\ {\
VERIFY_ARE_EQUAL(func(dataSet[size]), dataSet[size]);\ VERIFY_ARE_EQUAL(func(dataSet[size]), dataSet[size]);\
}\ }\
@ -35,7 +35,7 @@ namespace CalculatorUnitTests
#define ASSERT_NEGATIVE_TESTCASES(func, dataSet) \ #define ASSERT_NEGATIVE_TESTCASES(func, dataSet) \
{\ {\
int size = sizeof(dataSet)/sizeof(*dataSet);\ int size = sizeof(dataSet)/sizeof(*dataSet);\
while(--size)\ while(--size >= 0)\
{\ {\
VERIFY_ARE_EQUAL(func(dataSet[size]), StringReference(L"NoOp"));\ VERIFY_ARE_EQUAL(func(dataSet[size]), StringReference(L"NoOp"));\
}\ }\
@ -45,7 +45,7 @@ namespace CalculatorUnitTests
#define START_LOOP(dataSet)\ #define START_LOOP(dataSet)\
{\ {\
int size = sizeof(dataSet)/sizeof(*dataSet);\ int size = sizeof(dataSet)/sizeof(*dataSet);\
while(--size)\ while(--size >= 0)\
{ {
#define END_LOOP\ #define END_LOOP\