Last active
June 15, 2023 09:14
-
-
Save LukasWoodtli/5336b1c56f5bdf9361d812c0feba8bcd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sstream> | |
// poor man's unit testing framework | |
#define ASSERT_EQUALS(a, b) do { \ | |
std::cerr << std::boolalpha; \ | |
std::stringstream as, bs; \ | |
as << a; bs << b; \ | |
if (as.str() != bs.str()) { \ | |
std::cerr << as.str() << "\nis not equal to\n" << bs.str() << "\nin line " << __LINE__ << std::endl; \ | |
exit(1); } } while(0) | |
#define DEBUG(d) do { \ | |
std::cerr << #d ": " << d << endl; } while(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment