Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jbirddog committed Jun 29, 2024
1 parent a3b7689 commit 8c6f5c6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
9 changes: 6 additions & 3 deletions code_buffer_test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@ check_code_buffer:
mov rdi, [_code_buffer.base]
.loop:
dec ecx
js .done

cmpsb
jne failure

dec ecx
jnz .loop
jmp .loop

.done:
ret
29 changes: 13 additions & 16 deletions kernel_test.inc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

macro tc1 tib, tib_len, expected, expected_len {
macro tc1 what {
call kernel_init

mov rsi, tib
mov ecx, tib_len
mov rsi, what##.blue
mov ecx, what##.blue_length
xor eax, eax

call kernel_loop
Expand All @@ -15,22 +15,22 @@ macro tc1 tib, tib_len, expected, expected_len {

ok

t 'has the exepected compilation'
t 'has the expected compilation'
mov rsi, expected
mov ecx, expected_len
mov rsi, what##.expected
mov ecx, what##.expected_length
call check_code_buffer

ok
call kernel_deinit
}

macro tc2 tib, tib_len {
macro tc2 what {
call kernel_init

mov rsi, tib
mov ecx, tib_len
mov rsi, what##.blue
mov ecx, what##.blue_length
xor eax, eax

call kernel_loop
Expand Down Expand Up @@ -73,13 +73,10 @@ kernel_test:
call kernel_deinit

tc1 one_byte.blue, one_byte.blue_length, \
one_byte.expected, one_byte.expected_length

tc1 clean_exit.blue, clean_exit.blue_length, \
clean_exit.expected, clean_exit.expected_length

tc2 bogus.blue, bogus.blue_length
tc1 one_byte
tc1 clean_exit
tc2 bogus
ret

Expand Down

0 comments on commit 8c6f5c6

Please sign in to comment.