this is a class for unit testing

Dependents:   OS

This is an UnitTest library. You can use for POST.

UnitTest.cpp

Committer:
sPymbed
Date:
2017-11-06
Revision:
2:543a87f138d2
Parent:
0:b8a9485ea4f3
Child:
3:658ba851ab74

File content as of revision 2:543a87f138d2:

#include "UnitTest.h"

void UnitTest::start(){
    testCount = 1;
    printf("UnitTest:\n\n");
    unitTest.start();
}

void UnitTest::end(){
    unitTest.stop();
    printf("End: %fs\n", unitTest.read());
}

void UnitTest::assert(int a, int b){
    printf("Test %d: ", testCount);
    if(a==b){
        printf("Passed\n\n");
    } else {
        printf("Failed\n");
        while(true){
            wait(1);
        }
    }
    testCount++;
}