X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Fchecks.cpp;h=67a66b7cafecb81708111791efdca493ab4b1055;hp=6f325d9e2c175a274a72596aae662f2a6c479cf2;hb=1f5afe37b4c079821de9810435fa9fa11e4ea17b;hpb=383d5eb3b0f0506810d9105a268f939125bfc347 diff --git a/check/checks.cpp b/check/checks.cpp index 6f325d9e..67a66b7c 100644 --- a/check/checks.cpp +++ b/check/checks.cpp @@ -3,7 +3,7 @@ * Main program that calls the individual tests. */ /* - * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2003 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 -#include #include #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. ";