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

tests: update for stricter type checks

This commit is contained in:
Uwe Krüger
2020-05-24 21:07:32 +02:00
committed by GitHub
parent 4e66c12557
commit fd4d28b7b6
25 changed files with 88 additions and 76 deletions

View File

@ -101,9 +101,9 @@ pub fn decode_in_buffer(data &string, buffer byteptr) int {
}
decoded_bytes := (char_a << 18) | (char_b << 12) | (char_c << 6) | (char_d << 0)
b[j] = decoded_bytes >> 16
b[j+1] = (decoded_bytes >> 8) & 0xff
b[j+2] = (decoded_bytes >> 0) & 0xff
b[j] = byte(decoded_bytes >> 16)
b[j+1] = byte((decoded_bytes >> 8) & 0xff)
b[j+2] = byte((decoded_bytes >> 0) & 0xff)
j += 3
}
return output_length

View File

@ -14,14 +14,14 @@ fn test_long_encoding(){
mut s := 0
ebuffer := malloc( s_encoded.len )
for i in 0..repeats {
for _ in 0..repeats {
resultsize := base64.encode_in_buffer(s_original, ebuffer)
s += resultsize
assert resultsize == s_encoded.len
}
dbuffer := malloc( s_decoded.len )
for i in 0..repeats {
for _ in 0..repeats {
resultsize := base64.decode_in_buffer(s_encoded, dbuffer)
s += resultsize
assert resultsize == s_decoded.len