Files
SDLPongCPP/.svn/pristine/82/82ac021484ae7dbe0373820a73953ab489287f61.svn-base
T
2018-06-25 21:48:45 -04:00

31 lines
581 B
Plaintext

#include "UTest.hpp"
const /*static*/ char * UTest::sp_pstr = "pass";
const /*static*/ char * UTest::sp_fstr = "fail";
UTest::UTest( const char * tstr ) {
init(tstr);
}
void UTest::init( const char * tstr ) {
mp_tstr = tstr;
m_pass = m_fail = 0;
}
void UTest::test ( const char * description, const int flag ) {
const char * pf = nullptr;
if (flag) {
pf = sp_pstr;
++m_pass;
} else {
pf = sp_fstr;
++m_fail;
}
printf("%s: %s -> %s\n", mp_tstr, description, pf);
}
void UTest::report() const {
printf("%s: pass: %ld, fail: %ld\n", mp_tstr, m_pass, m_fail);
}