* Main program that calls the individual tests. */
/*
- * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2005 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
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdexcept>
-#include <iostream>
#include <time.h>
#include "checks.h"
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. ";