mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Merge branch 'master' of https://github.com/odin-lang/Odin
This commit is contained in:
@@ -139,7 +139,13 @@ Context_Memory_Input :: struct #packed {
|
|||||||
size_packed: i64,
|
size_packed: i64,
|
||||||
size_unpacked: i64,
|
size_unpacked: i64,
|
||||||
}
|
}
|
||||||
#assert(size_of(Context_Memory_Input) == 64)
|
when size_of(rawptr) == 8 {
|
||||||
|
#assert(size_of(Context_Memory_Input) == 64)
|
||||||
|
} else {
|
||||||
|
// e.g. `-target:windows_386`
|
||||||
|
#assert(size_of(Context_Memory_Input) == 52)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Context_Stream_Input :: struct #packed {
|
Context_Stream_Input :: struct #packed {
|
||||||
input_data: []u8,
|
input_data: []u8,
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ E_GZIP :: compress.GZIP_Error
|
|||||||
E_ZLIB :: compress.ZLIB_Error
|
E_ZLIB :: compress.ZLIB_Error
|
||||||
E_Deflate :: compress.Deflate_Error
|
E_Deflate :: compress.Deflate_Error
|
||||||
|
|
||||||
GZIP_MAX_PAYLOAD_SIZE :: int(max(u32le))
|
GZIP_MAX_PAYLOAD_SIZE :: i64(max(u32le))
|
||||||
|
|
||||||
load :: proc{load_from_slice, load_from_file, load_from_context}
|
load :: proc{load_from_slice, load_from_file, load_from_context}
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ load_from_context :: proc(z: ^$C, buf: ^bytes.Buffer, known_gzip_size := -1, exp
|
|||||||
|
|
||||||
z.output = buf
|
z.output = buf
|
||||||
|
|
||||||
if expected_output_size > GZIP_MAX_PAYLOAD_SIZE {
|
if i64(expected_output_size) > i64(GZIP_MAX_PAYLOAD_SIZE) {
|
||||||
return E_GZIP.Payload_Size_Exceeds_Max_Payload
|
return E_GZIP.Payload_Size_Exceeds_Max_Payload
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ main :: proc() {
|
|||||||
gzip_test(&t)
|
gzip_test(&t)
|
||||||
|
|
||||||
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
||||||
|
if TEST_fail > 0 {
|
||||||
|
os.exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@test
|
@test
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import "core:crypto/jh"
|
|||||||
import "core:crypto/groestl"
|
import "core:crypto/groestl"
|
||||||
import "core:crypto/haval"
|
import "core:crypto/haval"
|
||||||
import "core:crypto/siphash"
|
import "core:crypto/siphash"
|
||||||
|
import "core:os"
|
||||||
|
|
||||||
TEST_count := 0
|
TEST_count := 0
|
||||||
TEST_fail := 0
|
TEST_fail := 0
|
||||||
@@ -127,6 +128,9 @@ main :: proc() {
|
|||||||
bench_modern(&t)
|
bench_modern(&t)
|
||||||
|
|
||||||
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
||||||
|
if TEST_fail > 0 {
|
||||||
|
os.exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TestHash :: struct {
|
TestHash :: struct {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package test_core_json
|
|||||||
import "core:encoding/json"
|
import "core:encoding/json"
|
||||||
import "core:testing"
|
import "core:testing"
|
||||||
import "core:fmt"
|
import "core:fmt"
|
||||||
|
import "core:os"
|
||||||
|
|
||||||
TEST_count := 0
|
TEST_count := 0
|
||||||
TEST_fail := 0
|
TEST_fail := 0
|
||||||
@@ -34,6 +35,9 @@ main :: proc() {
|
|||||||
marshal_json(&t)
|
marshal_json(&t)
|
||||||
|
|
||||||
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
||||||
|
if TEST_fail > 0 {
|
||||||
|
os.exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@test
|
@test
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import "core:hash"
|
|||||||
import "core:time"
|
import "core:time"
|
||||||
import "core:testing"
|
import "core:testing"
|
||||||
import "core:fmt"
|
import "core:fmt"
|
||||||
|
import "core:os"
|
||||||
|
|
||||||
TEST_count := 0
|
TEST_count := 0
|
||||||
TEST_fail := 0
|
TEST_fail := 0
|
||||||
@@ -35,6 +36,9 @@ main :: proc() {
|
|||||||
test_xxhash_vectors(&t)
|
test_xxhash_vectors(&t)
|
||||||
test_crc64_vectors(&t)
|
test_crc64_vectors(&t)
|
||||||
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
||||||
|
if TEST_fail > 0 {
|
||||||
|
os.exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ main :: proc() {
|
|||||||
png_test(&t)
|
png_test(&t)
|
||||||
|
|
||||||
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
||||||
|
if TEST_fail > 0 {
|
||||||
|
os.exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PNG_Test :: struct {
|
PNG_Test :: struct {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package test_core_math_noise
|
|||||||
import "core:testing"
|
import "core:testing"
|
||||||
import "core:math/noise"
|
import "core:math/noise"
|
||||||
import "core:fmt"
|
import "core:fmt"
|
||||||
|
import "core:os"
|
||||||
|
|
||||||
TEST_count := 0
|
TEST_count := 0
|
||||||
TEST_fail := 0
|
TEST_fail := 0
|
||||||
@@ -35,6 +36,9 @@ main :: proc() {
|
|||||||
t := testing.T{}
|
t := testing.T{}
|
||||||
noise_test(&t)
|
noise_test(&t)
|
||||||
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
||||||
|
if TEST_fail > 0 {
|
||||||
|
os.exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Test_Vector :: struct {
|
Test_Vector :: struct {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package test_core_odin_parser
|
|||||||
|
|
||||||
import "core:testing"
|
import "core:testing"
|
||||||
import "core:fmt"
|
import "core:fmt"
|
||||||
|
import "core:os"
|
||||||
import "core:odin/parser"
|
import "core:odin/parser"
|
||||||
|
|
||||||
|
|
||||||
@@ -35,6 +35,9 @@ main :: proc() {
|
|||||||
test_parse_demo(&t)
|
test_parse_demo(&t)
|
||||||
|
|
||||||
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
||||||
|
if TEST_fail > 0 {
|
||||||
|
os.exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package test_core_image
|
|||||||
import "core:strings"
|
import "core:strings"
|
||||||
import "core:testing"
|
import "core:testing"
|
||||||
import "core:fmt"
|
import "core:fmt"
|
||||||
|
import "core:os"
|
||||||
|
|
||||||
TEST_count := 0
|
TEST_count := 0
|
||||||
TEST_fail := 0
|
TEST_fail := 0
|
||||||
@@ -35,6 +36,9 @@ main :: proc() {
|
|||||||
test_index_any_larger_string_found(&t)
|
test_index_any_larger_string_found(&t)
|
||||||
|
|
||||||
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
||||||
|
if TEST_fail > 0 {
|
||||||
|
os.exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@test
|
@test
|
||||||
|
|||||||
+4
@@ -14,6 +14,7 @@ package test_vendor_botan
|
|||||||
|
|
||||||
import "core:testing"
|
import "core:testing"
|
||||||
import "core:fmt"
|
import "core:fmt"
|
||||||
|
import "core:os"
|
||||||
|
|
||||||
import "vendor:botan/md4"
|
import "vendor:botan/md4"
|
||||||
import "vendor:botan/md5"
|
import "vendor:botan/md5"
|
||||||
@@ -86,6 +87,9 @@ main :: proc() {
|
|||||||
test_siphash_2_4(&t)
|
test_siphash_2_4(&t)
|
||||||
|
|
||||||
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
||||||
|
if TEST_fail > 0 {
|
||||||
|
os.exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TestHash :: struct {
|
TestHash :: struct {
|
||||||
|
|||||||
+4
@@ -3,6 +3,7 @@ package test_vendor_glfw
|
|||||||
import "core:testing"
|
import "core:testing"
|
||||||
import "core:fmt"
|
import "core:fmt"
|
||||||
import "vendor:glfw"
|
import "vendor:glfw"
|
||||||
|
import "core:os"
|
||||||
|
|
||||||
GLFW_MAJOR :: 3
|
GLFW_MAJOR :: 3
|
||||||
GLFW_MINOR :: 3
|
GLFW_MINOR :: 3
|
||||||
@@ -36,6 +37,9 @@ main :: proc() {
|
|||||||
test_glfw(&t)
|
test_glfw(&t)
|
||||||
|
|
||||||
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count)
|
||||||
|
if TEST_fail > 0 {
|
||||||
|
os.exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
|
|||||||
Reference in New Issue
Block a user