Created
September 12, 2011 12:31
-
-
Save wsdookadr/1211145 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 <iostream> | |
| #include <string> | |
| #include <stdlib.h> | |
| using namespace std; | |
| /* | |
| * Minimalistic testing "framework" | |
| * | |
| */ | |
| template <class T> | |
| void ok(T a,T b,string message) { | |
| if(a==b) { | |
| cout<<"[OK] "+message+"\n"; | |
| } else { | |
| cout<<"[NOT OK] "+message+"\n"; | |
| exit(-1); | |
| }; | |
| }; | |
| int main() { | |
| string computedString = "abc"; | |
| ok<string>(computedString,"abc","string computed"); | |
| int computedInt = 322; | |
| ok<int>(computedInt,321,"frobnitzer frequency computed"); | |
| return 0; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment