this is a class for unit testing

Dependents:   OS

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers UnitTest.cpp Source File

UnitTest.cpp

00001 #include "UnitTest.h"
00002 
00003 void UnitTest::start(){
00004     testCount = 1;
00005     printf("UnitTest:\n\r");
00006     unitTest.start();
00007 }
00008 
00009 void UnitTest::end(){
00010     unitTest.stop();
00011     printf("End: %fs\n\r", unitTest.read());
00012 }
00013 
00014 void UnitTest::assertOn(int a, int b){
00015     printf("Test %d: ", testCount);
00016     if(a == b){
00017         printf("Passed\n\r");
00018     } else {
00019         printf("Failed\n\r");
00020         while(true){
00021             wait(1);
00022         }
00023     }
00024     testCount++;
00025 }