Created
September 22, 2015 18:26
-
-
Save dacap/161de21d34c3dadae645 to your computer and use it in GitHub Desktop.
This file contains 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
#pragma once | |
#include <cstdlib> | |
#include <iostream> | |
template<typename T, typename U> | |
inline void expect_eq(const T& expected, const U& value, | |
const char* file, const int line) { | |
if (expected != value) { | |
std::cout << file << ":" << line << ": failed\n" | |
<< " Expected: " << expected << "\n" | |
<< " Actual: " << value << "\n"; | |
std::exit(1); | |
} | |
} | |
#define EXPECT_EQ(expected, value) \ | |
expect_eq(expected, value, __FILE__, __LINE__); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment