[m-rev.] for review: Fix failing tabled_typeclass test case.

Peter Wang novalazy at gmail.com
Tue Aug 7 17:16:38 AEST 2018


tests/debugger/Mmakefile:
    Filter memory addresses from the output.

tests/debugger/tabled_typeclass.inp:
    Print all io actions in two steps: 0-5 for non-debug grades,
    then 6-29 for debug grades.

tests/debugger/tabled_typeclass.exp:
tests/debugger/tabled_typeclass.exp2:
    Update expected outputs.

    Conform to changes to the io module.

diff --git a/tests/debugger/Mmakefile b/tests/debugger/Mmakefile
index 0d1f631f1..57a0587c0 100644
--- a/tests/debugger/Mmakefile
+++ b/tests/debugger/Mmakefile
@@ -590,21 +590,23 @@ tabled_read_unitize.out: tabled_read_unitize.data
 tabled_read_unitize.out: tabled_read_unitize tabled_read_unitize.inp
 	$(MDB_STD) ./tabled_read_unitize < tabled_read_unitize.inp \
 		> tabled_read_unitize.out 2>&1
 
 tabled_read_decl.out: tabled_read_decl tabled_read_decl.inp tabled_read_decl.data
 	$(MDB_STD) ./tabled_read_decl < tabled_read_decl.inp 2>&1 | \
 		sed 's/c_pointer(0x[-0-9A-Fa-f]*)/c_pointer(0xXXXX)/g' \
 		> tabled_read_decl.out 2>&1
 
 tabled_typeclass.out: tabled_typeclass tabled_typeclass.inp
-	$(MDB_STD) ./tabled_typeclass < tabled_typeclass.inp \
+	$(MDB_STD) ./tabled_typeclass < tabled_typeclass.inp 2>&1 | \
+		sed 's/0x[-0-9A-Fa-f]*/0xXXXX/g' | \
+		sed 's/(nil)/0xXXXX/g' \
 		> tabled_typeclass.out 2>&1
 
 tailrec1.out: tailrec1 tailrec1.inp tailrec1.data
 	$(MDB_STD) ./tailrec1 < tailrec1.inp > tailrec1.out 2>&1
 
 term_size_cells.out: term_size_cells term_size_cells.inp
 	$(MDB_STD) ./term_size_cells < term_size_cells.inp \
 		> term_size_cells.out 2>&1
 
 term_size_words.out: term_size_words term_size_words.inp
diff --git a/tests/debugger/tabled_typeclass.exp b/tests/debugger/tabled_typeclass.exp
index 1dae42f43..e5b4d2019 100644
--- a/tests/debugger/tabled_typeclass.exp
+++ b/tests/debugger/tabled_typeclass.exp
@@ -8,32 +8,47 @@ mdb> table_io allow
 mdb> table_io start
 I/O tabling started.
 mdb> finish
 1
 2
 3
 4
 5
 6
       E2:     C1 EXIT pred tabled_typeclass.main/2-0 (det)
-mdb> print io *
+mdb> print io limits
+I/O tabling has recorded actions 0 to 29.
+mdb> print io 0-5
 action 0: tc_action("the arguments are not available due to the presence of one or more type class constraints")
-action 1: write_int(1)
-action 2: write_char('\n')
-action 3: notc_action(status, status_success, 2)
-action 4: write_int(2)
-action 5: write_char('\n')
-action 6: tc_action("the arguments are not available due to the presence of one or more type class constraints")
-action 7: write_int(3)
-action 8: write_char('\n')
-action 9: notc_action(status, status_no_memory, 4)
-action 10: write_int(4)
-action 11: write_char('\n')
-action 12: tc_action("the arguments are not available due to the presence of one or more type class constraints")
-action 13: write_int(5)
-action 14: write_char('\n')
-action 15: notc_action(status, status_null_pointer, 6)
-action 16: write_int(6)
-action 17: write_char('\n')
+action 1: output_stream_2(stream(1, output, preopen, stdout))
+action 2: do_write_int(<<foreign(stream, 0xXXXX)>>, 1, <<foreign(system_error, 0xXXXX)>>)
+action 3: output_stream_2(stream(1, output, preopen, stdout))
+action 4: do_write_char(<<foreign(stream, 0xXXXX)>>, '\n', <<foreign(system_error, 0xXXXX)>>)
+action 5: notc_action(status, status_success, 2)
+mdb> print io 6-29
+action 6: output_stream_2(stream(1, output, preopen, stdout))
+action 7: do_write_int(<<foreign(stream, 0xXXXX)>>, 2, <<foreign(system_error, 0xXXXX)>>)
+action 8: output_stream_2(stream(1, output, preopen, stdout))
+action 9: do_write_char(<<foreign(stream, 0xXXXX)>>, '\n', <<foreign(system_error, 0xXXXX)>>)
+action 10: tc_action("the arguments are not available due to the presence of one or more type class constraints")
+action 11: output_stream_2(stream(1, output, preopen, stdout))
+action 12: do_write_int(<<foreign(stream, 0xXXXX)>>, 3, <<foreign(system_error, 0xXXXX)>>)
+action 13: output_stream_2(stream(1, output, preopen, stdout))
+action 14: do_write_char(<<foreign(stream, 0xXXXX)>>, '\n', <<foreign(system_error, 0xXXXX)>>)
+action 15: notc_action(status, status_no_memory, 4)
+action 16: output_stream_2(stream(1, output, preopen, stdout))
+action 17: do_write_int(<<foreign(stream, 0xXXXX)>>, 4, <<foreign(system_error, 0xXXXX)>>)
+action 18: output_stream_2(stream(1, output, preopen, stdout))
+action 19: do_write_char(<<foreign(stream, 0xXXXX)>>, '\n', <<foreign(system_error, 0xXXXX)>>)
+action 20: tc_action("the arguments are not available due to the presence of one or more type class constraints")
+action 21: output_stream_2(stream(1, output, preopen, stdout))
+action 22: do_write_int(<<foreign(stream, 0xXXXX)>>, 5, <<foreign(system_error, 0xXXXX)>>)
+action 23: output_stream_2(stream(1, output, preopen, stdout))
+action 24: do_write_char(<<foreign(stream, 0xXXXX)>>, '\n', <<foreign(system_error, 0xXXXX)>>)
+action 25: notc_action(status, status_null_pointer, 6)
+action 26: output_stream_2(stream(1, output, preopen, stdout))
+action 27: do_write_int(<<foreign(stream, 0xXXXX)>>, 6, <<foreign(system_error, 0xXXXX)>>)
+action 28: output_stream_2(stream(1, output, preopen, stdout))
+action 29: do_write_char(<<foreign(stream, 0xXXXX)>>, '\n', <<foreign(system_error, 0xXXXX)>>)
 mdb> retry -f
       E1:     C1 CALL pred tabled_typeclass.main/2-0 (det)
 mdb> continue
diff --git a/tests/debugger/tabled_typeclass.exp2 b/tests/debugger/tabled_typeclass.exp2
index 3f1d02352..1ef49b7c8 100644
--- a/tests/debugger/tabled_typeclass.exp2
+++ b/tests/debugger/tabled_typeclass.exp2
@@ -8,26 +8,30 @@ mdb> table_io allow
 mdb> table_io start
 I/O tabling started.
 mdb> finish
 1
 2
 3
 4
 5
 6
       E2:     C1 EXIT pred tabled_typeclass.main/2-0 (det)
-mdb> print io *
+mdb> print io limits
+I/O tabling has recorded actions 0 to 5.
+mdb> print io 0-5
 action 0: tc_action("the arguments are not available due to the presence of one or more type class constraints")
 action 1: notc_action(status, status_success, 2)
 action 2: tc_action("the arguments are not available due to the presence of one or more type class constraints")
 action 3: notc_action(status, status_no_memory, 4)
 action 4: tc_action("the arguments are not available due to the presence of one or more type class constraints")
 action 5: notc_action(status, status_null_pointer, 6)
+mdb> print io 6-29
+I/O tabling has only recorded actions 0 to 5.
 mdb> retry -f
       E1:     C1 CALL pred tabled_typeclass.main/2-0 (det)
 mdb> continue
 1
 2
 3
 4
 5
 6
diff --git a/tests/debugger/tabled_typeclass.inp b/tests/debugger/tabled_typeclass.inp
index 20ab51d48..1649a899f 100644
--- a/tests/debugger/tabled_typeclass.inp
+++ b/tests/debugger/tabled_typeclass.inp
@@ -1,9 +1,11 @@
 echo on
 context none
 register --quiet
 table_io allow
 table_io start
 finish
-print io *
+print io limits
+print io 0-5
+print io 6-29
 retry -f
 continue
-- 
2.18.0



More information about the reviews mailing list