diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-02-03 23:31:03 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-02-03 23:33:48 -0800 |
commit | ddd2e9891e843279cf1c190c1ee7c5ceef9ef96b (patch) | |
tree | d6bba236bd6b28402436ce60e004decd0b951f78 /subx/062write-stream.subx | |
parent | 51b4f888dd20653bb218f06e1221a7007446fcd5 (diff) | |
download | mu-ddd2e9891e843279cf1c190c1ee7c5ceef9ef96b.tar.gz |
4951
Cleaner way to compare streams in tests.
Diffstat (limited to 'subx/062write-stream.subx')
-rw-r--r-- | subx/062write-stream.subx | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/subx/062write-stream.subx b/subx/062write-stream.subx index f112dee9..a4dd73b7 100644 --- a/subx/062write-stream.subx +++ b/subx/062write-stream.subx @@ -12,7 +12,7 @@ #? 68/push 1/imm32/stdout #? e8/call write-stream/disp32 # automatic test -#? e8/call test-write-stream-appends/disp32 +#? e8/call test-write-stream-single/disp32 e8/call run-tests/disp32 # 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'. # syscall(exit, Num-test-failures) 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32 # copy *Num-test-failures to EBX @@ -150,15 +150,13 @@ test-write-stream-single: e8/call write-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - # check-ints-equal(*_test-stream->data, 41/A 62/b 00 00, msg) + # check-stream-equal(_test-stream, "Ab", msg) # . . push args 68/push "F - test-write-stream-single"/imm32 - 68/push 0x006241/imm32/Ab - # . . push *_test-stream->data - b8/copy-to-EAX _test-stream/imm32 - ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 . # push *(EAX+12) + 68/push "Ab"/imm32 + 68/push _test-stream/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 @@ -214,15 +212,13 @@ test-write-stream-appends: e8/call write-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - # check-ints-equal(*_test-stream->data, 43/C 44/D 00 00, msg) + # check-stream-equal(_test-stream, "CD", msg) # . . push args 68/push "F - test-write-stream-appends"/imm32 - 68/push 0x00004443/imm32/C-D - # . . push *_test-stream->data - b8/copy-to-EAX _test-stream/imm32 - ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 . # push *(EAX+12) + 68/push "CD"/imm32 + 68/push _test-stream/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 |