]> www.ginac.de Git - ginac.git/blobdiff - check/checks.cpp
synced to 1.2 (typos, better ncmul::degree() and ::coeff())
[ginac.git] / check / checks.cpp
index 85c56ba2fc6efca85650b7f137935c42fcc00994..c4cc1e0688749eb9ff68083510819026d74b3067 100644 (file)
@@ -3,7 +3,7 @@
  *  Main program that calls the individual tests. */
 
 /*
- *  GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -21,7 +21,6 @@
  */
 
 #include <stdexcept>
-#include <iostream>
 #include <time.h>
 
 #include "checks.h"
@@ -31,38 +30,20 @@ int main()
        unsigned result = 0;
        
        srand((unsigned)time(NULL));
+
+#define CHECK(which) \
+try { \
+       for (int i=0; i<1; ++i) \
+               result += check_ ## which (); \
+} catch (const exception &e) { \
+       cout << "Error: caught exception " << e.what() << endl; \
+       ++result; \
+}
        
-       try {
-               for (int i=0; i<1; ++i)
-                       result += check_numeric();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               for (int i=0; i<1; ++i)
-                       result += check_inifcns();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               for (int i=0; i<1; ++i)
-                       result += check_matrices();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               for (int i=0; i<1; ++i)
-                       result += check_lsolve();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
+       CHECK(numeric)
+       CHECK(inifcns)
+       CHECK(matrices)
+       CHECK(lsolve)
        
        if (result) {
                cout << "Error: something went wrong. ";