Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The test:
- const stringImpl input1("2");
- const stringImpl input2("b");
- CHECK_TRUE(Util::IsNumber(input1));
- CHECK_FALSE(Util::IsNumber(input2));
- The "new macros" (quick hack):
- #define CHECK_TRUE(exp) if (!(exp)) return Error("( " #exp " ) == true")
- #define CHECK_FALSE(exp) if (exp) return Error("( " #exp " ) == false")
- #define CHECK_EQUAL(exp, value) if (exp != value) return Error("( " #exp " ) == ( " #value " )")
- #define CHECK_NOT_EQUAL(exp, value) if (exp == value) return Error("( " #exp " ) != ( " #value " )")
- The new Error() :
- I32 Error(const char* errString) {
- printf("Error: %s\n", errString);
- return GENERAL_ERROR;
- }
- Now I can actually see what test actually failed by searching for the expression as a simple string search
Advertisement
Add Comment
Please, Sign In to add comment