]> www.ginac.de Git - cln.git/blobdiff - tests/test_I_io.cc
Fix configury (intptr_t test) for cross-compilation.
[cln.git] / tests / test_I_io.cc
index cbc4b1ee115c36297817921c2894af0e537c1f4a..2882aede099b8391b094ef1fc395728e29755590 100644 (file)
@@ -7,11 +7,23 @@ int test_I_io (int iterations)
        int error = 0;
        for (int i = iterations; i > 0; i--) {
                cl_I a = testrandom_I();
-               int base = iterations % (36-1) + 2;
+               unsigned base = iterations % (36-1) + 2;
                cl_read_flags rflags = {syntax_integer, lsyntax_standard, base};
                stringstream buf;
                print_integer(buf, base, a);
-               ASSERT1(a == read_integer(buf, rflags), a);
+               cl_I b;
+               try {
+                       b = read_integer(buf, rflags);
+                       ASSERT1(a == b, a);
+               } catch (runtime_exception& err) {
+                       std::cerr << "Got an error while parsing \"" 
+                               << buf.str() << "\" with base = " << base
+                               << " (in decimal: " << a << ")" << std::endl;
+                       std::cerr << "Details: " << err.what() << std::endl;
+                       ++error;
+                       break;
+               }
+
        }
        return error;
 }