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/064write-byte.subx | |
parent | 51b4f888dd20653bb218f06e1221a7007446fcd5 (diff) | |
download | mu-ddd2e9891e843279cf1c190c1ee7c5ceef9ef96b.tar.gz |
4951
Cleaner way to compare streams in tests.
Diffstat (limited to 'subx/064write-byte.subx')
-rw-r--r-- | subx/064write-byte.subx | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/subx/064write-byte.subx b/subx/064write-byte.subx index 9c9b50a6..1d14b06b 100644 --- a/subx/064write-byte.subx +++ b/subx/064write-byte.subx @@ -146,15 +146,13 @@ test-write-byte-single: e8/call flush/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP - # check-ints-equal(*_test-stream->data, 'A', msg) + # check-stream-equal(_test-stream, "A", msg) # . . push args 68/push "F - test-write-byte-single"/imm32 - 68/push 0x41/imm32 - # . . 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 "A"/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 @@ -205,26 +203,13 @@ test-write-byte-multiple-flushes: e8/call flush/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP - # check-ints-equal(_test-stream->data[0..3], 'abcd', msg) + # check-stream-equal(_test-stream, "abcdef", msg) # . . push args 68/push "F - test-write-byte-multiple-flushes: 1"/imm32 - 68/push 0x64636261/imm32 - # . . 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) - # . . call - 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->data[4..8], 'efg', msg) - # . . push args - 68/push "F - test-write-byte-multiple-flushes"/imm32 - 68/push 0x00676665/imm32 - # . . push *_test-stream->data - b8/copy-to-EAX _test-stream/imm32 - ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0x10/disp8 . # push *(EAX+16) + 68/push "abcdefg"/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 |