You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
401 B

  1. #include "test_I.h"
  2. #include <cln/input.h>
  3. #include <sstream>
  4. int test_I_io (int iterations)
  5. {
  6. int error = 0;
  7. for (int i = iterations; i > 0; i--) {
  8. cl_I a = testrandom_I();
  9. int base = iterations % (36-1) + 2;
  10. cl_read_flags rflags = {syntax_integer, lsyntax_standard, base};
  11. stringstream buf;
  12. print_integer(buf, base, a);
  13. ASSERT1(a == read_integer(buf, rflags), a);
  14. }
  15. return error;
  16. }