about summary refs log tree commit diff stats
path: root/subx/071read-line.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-02-03 23:31:03 -0800
committerKartik Agaram <vc@akkartik.com>2019-02-03 23:33:48 -0800
commitddd2e9891e843279cf1c190c1ee7c5ceef9ef96b (patch)
treed6bba236bd6b28402436ce60e004decd0b951f78 /subx/071read-line.subx
parent51b4f888dd20653bb218f06e1221a7007446fcd5 (diff)
downloadmu-ddd2e9891e843279cf1c190c1ee7c5ceef9ef96b.tar.gz
4951
Cleaner way to compare streams in tests.
Diffstat (limited to 'subx/071read-line.subx')
-rw-r--r--subx/071read-line.subx13
1 files changed, 6 insertions, 7 deletions
diff --git a/subx/071read-line.subx b/subx/071read-line.subx
index 961fc521..1412fb13 100644
--- a/subx/071read-line.subx
+++ b/subx/071read-line.subx
@@ -184,7 +184,8 @@ test-read-line:
     e8/call  check-ints-equal/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
-    # check-ints-equal(*_test-stream-buffer->data, 61/a 62/b 0a/newline 00, msg)
+    # check-stream-equal(_test-stream-buffer, "ab\n")
+    # . check-ints-equal(*_test-stream-buffer->data, 61/a 62/b 0a/newline 00, msg)
     # . . push args
     68/push  "F - test-read-line"/imm32
     68/push  0x000a6261/imm32
@@ -295,15 +296,13 @@ test-read-line-reads-final-line-until-eof:
     e8/call  check-ints-equal/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
-    # check-ints-equal(*_test-stream-buffer->data, 63/c 64/d 00 00, msg)
+    # check-stream-equal(_test-stream-buffer, "cd", msg)
     # . . push args
     68/push  "F - test-read-line-reads-final-line-until-eof"/imm32
-    68/push  0x00006463/imm32
-    # . . push *_test-stream->data
-    b8/copy-to-EAX  _test-stream-buffer/imm32
-    ff          6/subop/push        1/mod/*+disp8   0/rm32/EAX    .           .             .           .           0xc/disp8       .                 # push *(EAX+12)
+    68/push  "cd"/imm32
+    68/push  _test-stream-buffer/imm32
     # . . call
-    e8/call  check-ints-equal/disp32
+    e8/call  check-stream-equal/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
     # end