1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
/*
* Copyright 2004, The University of Toronto
* Licensed under GPL.
*/
#include "ksttestcase.h"
static void exitHelper() {
KST::vectorList.clear();
KST::scalarList.clear();
KST::dataObjectList.clear();
}
int rc = KstTestSuccess;
#define doTest(x) testAssert(x, QString("Line %1").arg(__LINE__))
#define doTestD(x, y) testAssert(x, QString("%1: %2").arg(__LINE__).arg(y))
void testAssert(bool result, const QString& text = "Unknown") {
if (!result) {
KstTestFailed();
printf("Test [%s] failed.\n", text.latin1());
}
}
void doTests() {
}
int main(int argc, char **argv) {
atexit(exitHelper);
KApplication app(argc, argv, "testtemplate", false, false);
doTests();
// Don't put tests in main because we need to ensure that no KstObjects
// remain past the exit handler
exitHelper(); // need to run it here before kapp goes away in some cases.
if (rc == KstTestSuccess) {
printf("All tests passed!\n");
}
return -rc;
}
// vim: ts=2 sw=2 et
|