]> www.ginac.de Git - ginac.git/blobdiff - check/exam_numeric.cpp
Fix some apparent typos and misindentations.
[ginac.git] / check / exam_numeric.cpp
index 89a3ceae0b030592924b6d5c84bee8037d9e75e1..8170e36477a414a8468b4f949ce02bd4a1306764 100644 (file)
@@ -1,10 +1,10 @@
 /** @file exam_numeric.cpp
  *
- *  These exams creates some numbers and check the result of several boolean
+ *  These exams creates some numbers and check the result of several Boolean
  *  tests on these numbers like is_integer() etc... */
 
 /*
- *  GiNaC Copyright (C) 1999-2005 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
  *
  *  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 "exams.h"
+#include "ginac.h"
+using namespace GiNaC;
 
+#include <iostream>
 #include <sstream>
+using namespace std;
 
 /* Simple and maybe somewhat pointless consistency tests of assorted tests and
  * conversions. */
@@ -65,6 +68,11 @@ static unsigned exam_numeric1()
                     << " erroneously not recognized as complex rational" << endl;
                ++result;
        }
+       if (test_crat.info(info_flags::nonnegative)) {
+               clog << test_crat
+                    << " erroneously recognized as non-negative number" << endl;
+               ++result;
+       }
        
        int i = numeric(1984).to_int();
        if (i-1984) {
@@ -378,7 +386,6 @@ unsigned exam_numeric()
        unsigned result = 0;
        
        cout << "examining consistency of numeric types" << flush;
-       clog << "----------consistency of numeric types:" << endl;
        
        result += exam_numeric1();  cout << '.' << flush;
        result += exam_numeric2();  cout << '.' << flush;
@@ -387,12 +394,10 @@ unsigned exam_numeric()
        result += exam_numeric5();  cout << '.' << flush;
        result += exam_numeric6();  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_numeric();
+}