1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package gpu_tests
import resource "../resource"
import "core:testing"
@(test)
test_gen_grid_geometry_batches_lines_into_one_mesh :: proc(t: ^testing.T) {
verts, indices := resource.gen_grid_geometry(10, 1, 0.01)
defer delete(verts)
defer delete(indices)
testing.expect_value(t, len(verts), 88)
testing.expect_value(t, len(indices), 264)
testing.expect_value(t, verts[0].position, [3]f32{-5.005, 0, -5})
testing.expect_value(t, verts[1].position, [3]f32{-4.995, 0, -5})
testing.expect_value(t, verts[2].position, [3]f32{-4.995, 0, 5})
testing.expect_value(t, verts[3].position, [3]f32{-5.005, 0, 5})
testing.expect_value(t, indices[0], u32(0))
testing.expect_value(t, indices[1], u32(2))
testing.expect_value(t, indices[2], u32(1))
testing.expect_value(t, indices[3], u32(0))
testing.expect_value(t, indices[4], u32(3))
testing.expect_value(t, indices[5], u32(2))
testing.expect_value(t, indices[6], u32(0))
testing.expect_value(t, indices[7], u32(1))
testing.expect_value(t, indices[8], u32(2))
testing.expect_value(t, indices[9], u32(0))
testing.expect_value(t, indices[10], u32(2))
testing.expect_value(t, indices[11], u32(3))
}