this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

paths relative to test file

+21 -5
flac

This is a binary file and will not be displayed.

formats

This is a binary file and will not be displayed.

library

This is a binary file and will not be displayed.

+16 -3
src/formats/flac.odin
··· 6 6 import "core:io" 7 7 import "core:mem" 8 8 import "core:os" 9 + import "core:path/filepath" 9 10 import "core:strconv" 10 11 import "core:strings" 11 12 import "core:testing" ··· 277 278 @(test) 278 279 should_read_flac_file :: proc(t: ^testing.T) { 279 280 file_path := "../../test-data/07. Vampire in the Corner.flac" 280 - f, ferr := os.open(file_path, {.Read}) 281 + 282 + input_path, test_err := filepath.join({#directory, file_path}, context.temp_allocator) 283 + testing.expect(t, test_err == nil) 284 + 285 + f, ferr := os.open(input_path, {.Read}) 281 286 if ferr != nil { 282 287 fmt.eprintfln("{}", ferr) 283 288 testing.expect(t, false, "failed to open flac file") ··· 306 311 should_check_flac_file :: proc(t: ^testing.T) { 307 312 308 313 file_path := "../../test-data/07. Vampire in the Corner.flac" 309 - f, ferr := os.open(file_path, {.Read}) 314 + 315 + input_path, test_err := filepath.join({#directory, file_path}, context.temp_allocator) 316 + testing.expect(t, test_err == nil) 317 + 318 + f, ferr := os.open(input_path, {.Read}) 310 319 if ferr != nil { 311 320 fmt.eprintfln("{}", ferr) 312 321 testing.expect(t, false, "failed to open flac file") ··· 329 338 should_return_error_on_non_flac_file :: proc(t: ^testing.T) { 330 339 331 340 file_path := "../../test-data/08. Last Dinosaurs - Purxst.wav" 332 - f, ferr := os.open(file_path, {.Read}) 341 + 342 + input_path, test_err := filepath.join({#directory, file_path}, context.temp_allocator) 343 + testing.expect(t, test_err == nil) 344 + 345 + f, ferr := os.open(input_path, {.Read}) 333 346 if ferr != nil { 334 347 fmt.eprintfln("{}", ferr) 335 348 testing.expect(t, false, "failed to open flac file")
+5 -2
src/library/library.odin
··· 6 6 import "core:mem/virtual" 7 7 import vmem "core:mem/virtual" 8 8 import "core:os" 9 + import "core:path/filepath" 9 10 import "core:slice" 10 11 import "core:strings" 11 12 import "core:testing" ··· 128 129 should_index_all_file_paths :: proc(t: ^testing.T) { 129 130 dir_path := "../../test-data/" 130 131 132 + input_path, test_err := filepath.join({#directory, dir_path}, context.temp_allocator) 133 + testing.expect(t, test_err == nil) 134 + 131 135 arena: vmem.Arena 132 136 arena_err := vmem.arena_init_growing(&arena) 133 137 defer vmem.arena_destroy(&arena) 134 138 135 139 testing.expect(t, arena_err == nil, "Failed to initialize arena") 136 140 137 - 138 141 arena_allocator := vmem.arena_allocator(&arena) 139 142 140 - paths_dyn := walk_dir(dir_path, arena_allocator) 143 + paths_dyn := walk_dir(input_path, arena_allocator) 141 144 defer delete_dynamic_array(paths_dyn) 142 145 143 146 paths := paths_dyn[:]