[m-rev.] diff: fix a test case failure in debug grades

Julien Fischer jfischer at opturion.com
Thu Jun 7 22:29:06 AEST 2018


Fix a test case failure in debug grades.

Fix the failure of declarative_debugger/io_stream_test in debug grades.
This has been broken since the commit d8c59a8, which changed the way the io
module reads characters.

tests/declarative_debugger/Mmakefile:
     Pipe the output of this test through sed to avoid machine
     specific memory addresses occurring in the output.

tests/declarative_debugger/io_stream_test.exp2:
     Update this expected output.

Julien.

diff --git a/tests/declarative_debugger/Mmakefile b/tests/declarative_debugger/Mmakefile
index 6fe651c..df75ece 100644
--- a/tests/declarative_debugger/Mmakefile
+++ b/tests/declarative_debugger/Mmakefile
@@ -395,7 +395,9 @@ io_read_bug.out: io_read_bug io_read_bug.inp
  	|| { grep . $@ /dev/null; exit 1; }

  io_stream_test.out: io_stream_test io_stream_test.inp
-	$(MDB_STD) ./io_stream_test < io_stream_test.inp \
+	$(MDB_STD) ./io_stream_test < io_stream_test.inp | \
+		sed 's/0x[-0-9A-Fa-f]*/0xXXXX/g' | \
+		sed 's/(nil)/0xXXXX/g'\
  		> io_stream_test.out 2>&1 \
  	|| { grep . $@ /dev/null; exit 1; }

diff --git a/tests/declarative_debugger/io_stream_test.exp2 b/tests/declarative_debugger/io_stream_test.exp2
index cd298c5..a5163ca 100644
--- a/tests/declarative_debugger/io_stream_test.exp2
+++ b/tests/declarative_debugger/io_stream_test.exp2
@@ -23,37 +23,41 @@ test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, _)
  mdb> dd -d 3 -n 7 -a
  test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, _)
  4 tabled IO actions:
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 49)
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 50)
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 51)
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 10)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '1', <<foreign(system_error, 0xXXXX)>>)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '2', <<foreign(system_error, 0xXXXX)>>)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '3', <<foreign(system_error, 0xXXXX)>>)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '
+', <<foreign(system_error, 0xXXXX)>>)
  Valid? print 1-2
  stream(0, input, text, file("tabled_read_decl.data"))
  1123
  dd> p io 1-2
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 49)
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 50)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '1', <<foreign(system_error, 0xXXXX)>>)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '2', <<foreign(system_error, 0xXXXX)>>)
  dd> no
  test_2(stream(0, input, text, file("tabled_read_decl.data")), 1, 1123, _, _)
  4 tabled IO actions:
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 49)
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 50)
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 51)
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 10)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '1', <<foreign(system_error, 0xXXXX)>>)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '2', <<foreign(system_error, 0xXXXX)>>)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '3', <<foreign(system_error, 0xXXXX)>>)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '
+', <<foreign(system_error, 0xXXXX)>>)
  Valid? yes
  Found incorrect contour:
  test_2(stream(0, input, text, file("tabled_read_decl.data")), 1, 1123, _, _)
  4 tabled IO actions:
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 49)
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 50)
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 51)
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 10)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '1', <<foreign(system_error, 0xXXXX)>>)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '2', <<foreign(system_error, 0xXXXX)>>)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '3', <<foreign(system_error, 0xXXXX)>>)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '
+', <<foreign(system_error, 0xXXXX)>>)
  test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, _)
  4 tabled IO actions:
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 49)
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 50)
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 51)
-read_char_code_2(stream(0, input, text, file("tabled_read_decl.data")), 10)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '1', <<foreign(system_error, 0xXXXX)>>)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '2', <<foreign(system_error, 0xXXXX)>>)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '3', <<foreign(system_error, 0xXXXX)>>)
+read_char_code_2(<<foreign(stream, 0xXXXX)>>, ok, '
+', <<foreign(system_error, 0xXXXX)>>)
  Is this a bug? yes
        E3:     C2 EXIT pred io_stream_test.test/4-0 (det)
  mdb> c -n -S


More information about the reviews mailing list