Call pass() in AbstractFifo unit test

This commit is contained in:
Vinnie Falco
2013-07-28 01:56:53 -07:00
parent 9fde380230
commit e30e663ab2

View File

@@ -180,7 +180,7 @@ public:
void runTest() void runTest()
{ {
beginTest ("AbstractFifo"); beginTestCase ("AbstractFifo");
int buffer [5000]; int buffer [5000];
AbstractFifo fifo (numElementsInArray (buffer)); AbstractFifo fifo (numElementsInArray (buffer));
@@ -190,6 +190,8 @@ public:
int n = 0; int n = 0;
Random r; Random r;
bool failed = false;
for (int count = 100000; --count >= 0;) for (int count = 100000; --count >= 0;)
{ {
int num = r.nextInt (6000) + 1; int num = r.nextInt (6000) + 1;
@@ -205,8 +207,6 @@ public:
break; break;
} }
bool failed = false;
for (int i = 0; i < size1; ++i) for (int i = 0; i < size1; ++i)
failed = (buffer [start1 + i] != n++) || failed; failed = (buffer [start1 + i] != n++) || failed;
@@ -215,12 +215,13 @@ public:
if (failed) if (failed)
{ {
expect (false, "read values were incorrect");
break; break;
} }
fifo.finishedRead (size1 + size2); fifo.finishedRead (size1 + size2);
} }
expect (! failed, "read values were incorrect");
} }
}; };