Add project files.

This commit is contained in:
2018-06-25 21:48:45 -04:00
parent b04a25689b
commit 3c1b7d28e8
425 changed files with 35333 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
#include "UTest.hpp"
const /*static*/ char * UTest::sp_pstr = "pass";
const /*static*/ char * UTest::sp_fstr = "fail";
/*static*/ unsigned long int UTest::s_pass = 0;
/*static*/ unsigned long int UTest::s_fail = 0;
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;
++s_pass;
} else {
pf = sp_fstr;
++m_fail;
++s_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);
}
/*static*/ void UTest::OverAllReport()
{
printf("\nOver All pass: %ld, fail: %ld\n", s_pass, s_fail);
}