Fix min() tests
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
mov rsi, %1
|
mov rsi, %1
|
||||||
mov rdx, %1
|
mov rdx, %1
|
||||||
mov rcx, rax
|
mov rcx, rax
|
||||||
cmp rax, %1
|
cmp rax, rdx
|
||||||
%2 %%true
|
%2 %%true
|
||||||
lea r8, [rel testMsg_False]
|
lea r8, [rel testMsg_False]
|
||||||
jmp %%cnt
|
jmp %%cnt
|
||||||
@@ -264,31 +264,31 @@ _start:
|
|||||||
mov rdi, -1337
|
mov rdi, -1337
|
||||||
mov rsi, 1337
|
mov rsi, 1337
|
||||||
call min
|
call min
|
||||||
assert rdi, je, testMsg_assertIEqual
|
assert -1337, je, testMsg_assertIEqual
|
||||||
; TEST 2: min(MIN_INT64, MAX_INT64)
|
; TEST 2: min(MIN_INT64, MAX_INT64)
|
||||||
printTest(min2)
|
printTest(min2)
|
||||||
mov rdi, MIN_INT64
|
mov rdi, MIN_INT64
|
||||||
mov rsi, MAX_INT64
|
mov rsi, MAX_INT64
|
||||||
call min
|
call min
|
||||||
assert rdi, je, testMsg_assertIEqual
|
assert MIN_INT64, je, testMsg_assertIEqual
|
||||||
; TEST 3: min(MIN_UINT64, MAX_UINT64)
|
; TEST 3: min(MIN_UINT64, MAX_UINT64)
|
||||||
printTest(min3)
|
printTest(min3)
|
||||||
mov rdi, MIN_UINT64
|
mov rdi, MIN_UINT64
|
||||||
mov rsi, MAX_UINT64
|
mov rsi, MAX_UINT64
|
||||||
call min
|
call min
|
||||||
assert rdi, je, testMsg_assertIEqual
|
assert MAX_UINT64, je, testMsg_assertIEqual
|
||||||
; TEST 4: min(-1, 0)
|
; TEST 4: min(-1, 0)
|
||||||
printTest(min4)
|
printTest(min4)
|
||||||
mov rdi, -1
|
mov rdi, -1
|
||||||
xor rsi, rdx
|
xor rsi, rsi
|
||||||
call min
|
call min
|
||||||
assert rdi, je, testMsg_assertIEqual
|
assert -1, je, testMsg_assertIEqual
|
||||||
; TEST 5: min(MIN_UINT64, MIN_INT8)
|
; TEST 5: min(MIN_UINT64, MIN_INT8)
|
||||||
printTest(min5)
|
printTest(min5)
|
||||||
mov rdi, MIN_UINT64
|
mov rdi, MIN_UINT64
|
||||||
mov rsi, MIN_INT8
|
mov rsi, MIN_INT8
|
||||||
call min
|
call min
|
||||||
assert rsi, je, testMsg_assertIEqual
|
assert MIN_INT8, je, testMsg_assertIEqual
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
|
Reference in New Issue
Block a user