aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-06-04 19:45:21 +0200
committerDanielGavin <danielgavin5@hotmail.com>2024-06-04 19:45:21 +0200
commit6c82924d0a56ca6868e89ba2559a0bf9ca07c16b (patch)
tree7263c9c3912978f68898fa85be6786436965c7b1 /tests
parentef77d6ab12be2c6d47ff33c3e7a04884c915e97d (diff)
Start fixing memory leaks on tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin50
-rw-r--r--tests/hover_test.odin4
-rw-r--r--tests/objc_test.odin8
-rw-r--r--tests/signatures_test.odin8
4 files changed, 35 insertions, 35 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index 4084c16..d74de1b 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -345,7 +345,7 @@ ast_completion_selector_on_indexed_array :: proc(t: ^testing.T) {
@(test)
index_package_completion :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -593,7 +593,7 @@ ast_swizzle_resolve_one_component_struct_completion :: proc(t: ^testing.T) {
@(test)
ast_for_in_for_from_different_package :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -872,7 +872,7 @@ ast_completion_in_between_struct :: proc(t: ^testing.T) {
@(test)
ast_overload_with_any_int_index_completion :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -916,7 +916,7 @@ ast_overload_with_any_int_index_completion :: proc(t: ^testing.T) {
@(test)
ast_package_procedure_completion :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -1041,7 +1041,7 @@ ast_basic_value_binary_completion :: proc(t: ^testing.T) {
@(test)
ast_file_private_completion :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -1070,7 +1070,7 @@ ast_file_private_completion :: proc(t: ^testing.T) {
@(test)
ast_non_mutable_variable_struct_completion :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -1098,7 +1098,7 @@ ast_non_mutable_variable_struct_completion :: proc(t: ^testing.T) {
@(test)
ast_mutable_variable_struct_completion :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -1130,9 +1130,9 @@ ast_out_of_block_scope_completion :: proc(t: ^testing.T) {
main = `package main
main :: proc() {
{
- aabb := 2
+ zzaabb := 2
}
- aab{*}
+ zzaab{*}
}
`,
}
@@ -1458,7 +1458,7 @@ ast_maybe_array :: proc(t: ^testing.T) {
@(test)
ast_maybe_index_completion :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -1584,7 +1584,7 @@ ast_overload_with_procedure_return :: proc(t: ^testing.T) {
@(test)
ast_index_proc_parameter_completion :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -1697,7 +1697,7 @@ ast_enum_complete :: proc(t: ^testing.T) {
@(test)
ast_comp_lit_with_all_symbols_indexed_enum_implicit :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -1735,7 +1735,7 @@ ast_comp_lit_with_all_symbols_indexed_enum_implicit :: proc(t: ^testing.T) {
@(test)
ast_package_uppercase_test :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -1777,7 +1777,7 @@ ast_package_uppercase_test :: proc(t: ^testing.T) {
@(test)
ast_index_enum_infer :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -1809,7 +1809,7 @@ ast_index_enum_infer :: proc(t: ^testing.T) {
@(test)
ast_index_enum_infer_call_expr :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -1967,7 +1967,7 @@ ast_switch_completion_for_maybe_enum :: proc(t: ^testing.T) {
@(test)
ast_union_with_type_from_different_package :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -2130,7 +2130,7 @@ ast_completion_on_call_expr :: proc(t: ^testing.T) {
@(test)
ast_completion_struct_with_same_name_in_pkg :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -2168,7 +2168,7 @@ ast_completion_struct_with_same_name_in_pkg :: proc(t: ^testing.T) {
@(test)
ast_completion_method_with_type :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -2201,7 +2201,7 @@ ast_completion_method_with_type :: proc(t: ^testing.T) {
@(test)
ast_implicit_bitset_value_decl_from_package :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -2237,7 +2237,7 @@ ast_implicit_bitset_value_decl_from_package :: proc(t: ^testing.T) {
@(test)
ast_private_proc_ignore :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -2269,7 +2269,7 @@ ast_private_proc_ignore :: proc(t: ^testing.T) {
@(test)
ast_bitset_assignment_diff_pkg :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -2602,7 +2602,7 @@ ast_completion_comp_lit_in_proc :: proc(t: ^testing.T) {
@(test)
ast_completion_infer_bitset_package :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -2668,7 +2668,7 @@ ast_simple_bit_field_completion :: proc(t: ^testing.T) {
@(test)
ast_generics_function_with_struct_same_pkg :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -2719,7 +2719,7 @@ ast_generics_function_with_struct_same_pkg :: proc(t: ^testing.T) {
@(test)
ast_generics_function_with_struct_diff_pkg :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -2770,7 +2770,7 @@ ast_generics_function_with_struct_diff_pkg :: proc(t: ^testing.T) {
@(test)
ast_generics_function_with_comp_lit_struct :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 1cee1dc..22403a0 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -58,7 +58,7 @@ ast_hover_parameter :: proc(t: ^testing.T) {
@(test)
ast_hover_external_package_parameter :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -88,7 +88,7 @@ ast_hover_external_package_parameter :: proc(t: ^testing.T) {
@(test)
ast_hover_procedure_package_parameter :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
diff --git a/tests/objc_test.odin b/tests/objc_test.odin
index 760d193..9c69afb 100644
--- a/tests/objc_test.odin
+++ b/tests/objc_test.odin
@@ -8,7 +8,7 @@ import test "src:testing"
@(test)
objc_return_type_with_selector_expression :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -49,7 +49,7 @@ objc_return_type_with_selector_expression :: proc(t: ^testing.T) {
@(test)
objc_return_type_with_selector_expression_2 :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -98,7 +98,7 @@ objc_return_type_with_selector_expression_2 :: proc(t: ^testing.T) {
@(test)
objc_hover_chained_selector :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -147,7 +147,7 @@ objc_hover_chained_selector :: proc(t: ^testing.T) {
@(test)
objc_implicit_enum_completion :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
diff --git a/tests/signatures_test.odin b/tests/signatures_test.odin
index 66b1b01..32e5e17 100644
--- a/tests/signatures_test.odin
+++ b/tests/signatures_test.odin
@@ -210,7 +210,7 @@ ast_proc_group_signature_empty_call :: proc(t: ^testing.T) {
test.expect_signature_labels(
t,
&source,
- {
+ {
"test.int_function: proc(a: int)",
"test.bool_function: proc(a: bool)",
},
@@ -237,7 +237,7 @@ ast_proc_signature_generic :: proc(t: ^testing.T) {
test.expect_signature_labels(
t,
&source,
- {
+ {
"test.clone_array: proc(array: $A/[]^$T, allocator: mem.Allocator, unique_strings: ^map[string]string) -> A",
},
)
@@ -354,7 +354,7 @@ ast_proc_group_signature_struct :: proc(t: ^testing.T) {
@(test)
index_simple_signature :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -464,7 +464,7 @@ ast_signature_global_variable_pointer :: proc(t: ^testing.T) {
@(test)
index_variable_pointer_signature :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,