Skip to content

Instantly share code, notes, and snippets.

@wsdookadr
Created September 12, 2011 12:31
Show Gist options
  • Select an option

  • Save wsdookadr/1211145 to your computer and use it in GitHub Desktop.

Select an option

Save wsdookadr/1211145 to your computer and use it in GitHub Desktop.
#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