X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Fexam_archive.cpp;h=cc5891cd7a8402abaa0df3b2dbf7a090bc74ce01;hp=a2e19c44d3dcc1f3c10cf82a100f35c37e53b645;hb=c532971f9e99886781437912ae1655719284ac2f;hpb=619d77d2676f7f1a562fb9fefc0ba6754fe2d750 diff --git a/check/exam_archive.cpp b/check/exam_archive.cpp index a2e19c44..cc5891cd 100644 --- a/check/exam_archive.cpp +++ b/check/exam_archive.cpp @@ -3,7 +3,7 @@ * Here we test GiNaC's archiving system. */ /* - * GiNaC Copyright (C) 1999-2007 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2015 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 @@ -20,16 +20,18 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "exams.h" +#include "ginac.h" +using namespace GiNaC; #include +#include +using namespace std; unsigned exam_archive() { unsigned result = 0; cout << "examining archiving system" << flush; - clog << "----------archiving system:" << endl; symbol x("x"), y("y"), mu("mu"), dim("dim", "\\Delta"); ex e, f; @@ -64,20 +66,17 @@ unsigned exam_archive() } f = ar.unarchive_ex(lst(x, y, mu, dim), "expr 1"); - if (!f.is_equal(e)) { + ex difference = (f - e).expand(); + if (!difference.is_zero()) { clog << "archiving/unarchiving " << e << endl << "erroneously returned " << f << endl; ++result; } - cout << '.' << flush; - - if (!result) { - cout << " passed " << endl; - clog << "(no output)" << endl; - } else { - cout << " failed " << endl; - } - return result; } + +int main(int argc, char** argv) +{ + return exam_archive(); +}