]> www.ginac.de Git - ginac.git/commitdiff
- introduced macros to shorten the source files
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Thu, 29 Mar 2001 20:48:17 +0000 (20:48 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Thu, 29 Mar 2001 20:48:17 +0000 (20:48 +0000)
- added exam_color()

check/Makefile.am
check/checks.cpp
check/exams.cpp
check/exams.h
check/exams.ref
check/times.cpp

index bb9ef632238efbe37ff3c16f9142c72f52aa6334..26ef258475273490b3944ecb3c9c6304b3730072 100644 (file)
@@ -10,7 +10,7 @@ checks_LDADD = ../ginac/libginac.la
 exams_SOURCES = exam_paranoia.cpp exam_numeric.cpp exam_powerlaws.cpp \
   exam_inifcns.cpp exam_differentiation.cpp exam_polygcd.cpp \
   exam_normalization.cpp exam_pseries.cpp exam_matrices.cpp exam_lsolve.cpp \
-  exam_indexed.cpp exam_misc.cpp exams.cpp exams.h
+  exam_indexed.cpp exam_color.cpp exam_misc.cpp exams.cpp exams.h
 exams_LDADD = ../ginac/libginac.la
 
 times_SOURCES = time_dennyfliegner.cpp time_gammaseries.cpp \
index 6f325d9e2c175a274a72596aae662f2a6c479cf2..6cfeaff8ab1a3f1e667e119fa5ef3613d4bf75b7 100644 (file)
@@ -31,38 +31,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. ";
index 385ed9a3df8c9663688d73960a782f5620c7177a..429bfc13bde4fcef85d8953c176393971f7caa8c 100644 (file)
 int main()
 {
        unsigned result = 0;
+
+#define EXAM(which) \
+try { \
+       result += exam_ ## which (); \
+} catch (const exception &e) { \
+       cout << "Error: caught exception " << e.what() << endl; \
+       ++result; \
+}
        
-       try {
-               result += exam_paranoia();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += exam_numeric();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += exam_powerlaws();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += exam_inifcns();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += exam_differentiation();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += exam_polygcd();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += exam_normalization();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += exam_pseries();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += exam_matrices();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += exam_lsolve();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += exam_indexed();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += exam_misc();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
+       EXAM(paranoia)
+       EXAM(numeric)
+       EXAM(powerlaws)
+       EXAM(inifcns)
+       EXAM(differentiation)
+       EXAM(polygcd)
+       EXAM(normalization)
+       EXAM(pseries)
+       EXAM(matrices)
+       EXAM(lsolve)
+       EXAM(indexed)
+       EXAM(color)
+       EXAM(misc)
        
        if (result) {
                cout << "Error: something went wrong. ";
index 6677659d0056b81221b23a5912ebd7780c5d59be..94ae18a1c0f23088ff6114a2ae0082ca4676054b 100644 (file)
@@ -39,6 +39,7 @@ unsigned exam_pseries();
 unsigned exam_matrices();
 unsigned exam_lsolve();
 unsigned exam_indexed();
+unsigned exam_color();
 unsigned exam_misc();
 
 #endif // ndef EXAMS_H
index f9c4afb40a8e1fdfc4e67f4cebb7cf8290a585b4..47d34012e3a5c696c8bbb8a924552ca65a6fd77a 100644 (file)
@@ -20,5 +20,7 @@
 (no output)
 ----------indexed objects:
 (no output)
+----------color objects:
+(no output)
 ----------miscellaneous other things:
 (no output)
index 246a51235649053b9279b6c1e983ba36b304b145..7b6858be9828b033cfc3ad7e243eadd2c2a0643b 100644 (file)
@@ -29,159 +29,36 @@ int main()
 {
        unsigned result = 0;
        
-       try {
-               result += time_dennyfliegner();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_gammaseries();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_vandermonde();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_toeplitz();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_A();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_B();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_C();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_D();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_E();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_F();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_G();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_H();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_IJKL();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_M1();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_M2();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_N();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_O();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_P();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_Pprime();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_Q();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_lw_Qprime();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
-       
-       try {
-               result += time_antipode();
-       } catch (const exception &e) {
-               cout << "Error: caught exception " << e.what() << endl;
-               ++result;
-       }
+#define TIME(which) \
+try { \
+       result += time_ ## which (); \
+} catch (const exception &e) { \
+       cout << "Error: caught exception " << e.what() << endl; \
+       ++result; \
+}
+
+       TIME(dennyfliegner)
+       TIME(gammaseries)
+       TIME(vandermonde)
+       TIME(toeplitz)
+       TIME(lw_A)
+       TIME(lw_B)
+       TIME(lw_C)
+       TIME(lw_D)
+       TIME(lw_E)
+       TIME(lw_F)
+       TIME(lw_G)
+       TIME(lw_H)
+       TIME(lw_IJKL)
+       TIME(lw_M1)
+       TIME(lw_M2)
+       TIME(lw_N)
+       TIME(lw_O)
+       TIME(lw_P)
+       TIME(lw_Pprime)
+       TIME(lw_Q)
+       TIME(lw_Qprime)
+       TIME(antipode)
        
        if (result) {
                cout << "Error: something went wrong. ";