1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: fix ptr_arithmetic_test.v

This commit is contained in:
Delyan Angelov 2021-04-05 08:25:08 +03:00
parent 5c07cbf5d3
commit 63a1c32a17
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -20,20 +20,20 @@ fn test_ptr_arithmetic() {
fn test_ptr_arithmetic_over_byteptr() { fn test_ptr_arithmetic_over_byteptr() {
// byteptr, voidptr, charptr are handled differently // byteptr, voidptr, charptr are handled differently
mut q := byteptr(10) mut q := &byte(10)
unsafe { unsafe {
q -= 2 q -= 2
q = q + 1 q = q + 1
} }
assert q == byteptr(9) assert u64(q) == u64(&byte(9))
s := unsafe { q - 1 } s := unsafe { q - 1 }
assert s == byteptr(8) assert u64(s) == u64(&byte(8))
unsafe { unsafe {
q++ q++
q++ q++
q-- q--
} }
assert q == byteptr(10) assert u64(q) == u64(&byte(10))
} }
struct Abc { struct Abc {