test completeness, couple semantics
This commit is contained in:
@@ -817,7 +817,7 @@ tokenise:
|
|||||||
jmp .operand_break_continue
|
jmp .operand_break_continue
|
||||||
|
|
||||||
; cx = token ID
|
; cx = token ID
|
||||||
.operand_addr_register
|
.operand_addr_register:
|
||||||
mov word [TOKEN_TABLE_ADDR + rax * TOKEN_TABLE_ENTRY_SIZE], 0x1000
|
mov word [TOKEN_TABLE_ADDR + rax * TOKEN_TABLE_ENTRY_SIZE], 0x1000
|
||||||
inc rax ; 0x1000: addr reg token, next token is the register
|
inc rax ; 0x1000: addr reg token, next token is the register
|
||||||
mov [TOKEN_TABLE_ADDR + rax * TOKEN_TABLE_ENTRY_SIZE], cx
|
mov [TOKEN_TABLE_ADDR + rax * TOKEN_TABLE_ENTRY_SIZE], cx
|
||||||
@@ -1417,12 +1417,12 @@ trim_trailing_whitespace:
|
|||||||
cmp al, 0 ; if last element whitespace
|
cmp al, 0 ; if last element whitespace
|
||||||
je .done ; then break
|
je .done ; then break
|
||||||
|
|
||||||
.trim ; otherwise one shorter
|
.trim: ; otherwise one shorter
|
||||||
dec rdi
|
dec rdi
|
||||||
call trim_trailing_whitespace
|
call trim_trailing_whitespace
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.done
|
.done:
|
||||||
mov rax, rdi
|
mov rax, rdi
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -1738,4 +1738,6 @@ program:
|
|||||||
db "hlt", 0x0A ; TODO make it so it doesn't need to end with a newline; this
|
db "hlt", 0x0A ; TODO make it so it doesn't need to end with a newline; this
|
||||||
; would mean range checking members in operator/operand/com-
|
; would mean range checking members in operator/operand/com-
|
||||||
; ment loops at the end of the program
|
; ment loops at the end of the program
|
||||||
.size db $ - program
|
.size dq $ - program
|
||||||
|
|
||||||
|
msg_end db "end of the binary ->|", 0x0A, 0x00
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ run_tests:
|
|||||||
mov rsi, .msg
|
mov rsi, .msg
|
||||||
call print.test
|
call print.test
|
||||||
|
|
||||||
|
call test_completeness
|
||||||
|
|
||||||
call clear_test_arena
|
call clear_test_arena
|
||||||
call test_djb2
|
call test_djb2
|
||||||
|
|
||||||
@@ -46,6 +48,27 @@ run_tests:
|
|||||||
ret
|
ret
|
||||||
.msg db "running test suite...", 0x0A, 0x00
|
.msg db "running test suite...", 0x0A, 0x00
|
||||||
|
|
||||||
|
; ------------------------------------------------------------------------------
|
||||||
|
; test_completeness
|
||||||
|
;
|
||||||
|
; description:
|
||||||
|
; visual confirmation of binary integrity
|
||||||
|
; ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
test_completeness:
|
||||||
|
mov rsi, .msg
|
||||||
|
call print.test
|
||||||
|
mov rsi, .msg_content
|
||||||
|
call print
|
||||||
|
mov rsi, msg_end
|
||||||
|
call print
|
||||||
|
mov rsi, .msg_confirm
|
||||||
|
call print
|
||||||
|
ret
|
||||||
|
.msg db "test_completeness...", 0x0A, 0x00
|
||||||
|
.msg_content db " here is the ", 0x00
|
||||||
|
.msg_confirm db " here is the end of the binary ->|", 0x0A, " assert: the previous 2 lines are identical", 0x0A, 0x00
|
||||||
|
|
||||||
; ------------------------------------------------------------------------------
|
; ------------------------------------------------------------------------------
|
||||||
; test_elemb
|
; test_elemb
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user