summaryrefslogtreecommitdiff
path: root/src/gl/gl.test.c
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-08-20 15:37:04 -0500
committersanine <sanine.not@pm.me>2022-08-20 15:37:04 -0500
commit8b9b325b092b7157996cfbcdd7ce38f9e876fff8 (patch)
tree4c878f4a887d435d8c464112c2ad0cef1a6db2c8 /src/gl/gl.test.c
parentb6ccd8b31a78ef99f8c346d9b60f123c7ac813ec (diff)
fix bug in gl.bufferData and add error checking
Diffstat (limited to 'src/gl/gl.test.c')
-rw-r--r--src/gl/gl.test.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gl/gl.test.c b/src/gl/gl.test.c
index aa24fd2..9782caf 100644
--- a/src/gl/gl.test.c
+++ b/src/gl/gl.test.c
@@ -67,10 +67,10 @@ void mock_glBufferData_(int target, size_t size, const void *data, int usage)
};
lily_mock_store_call(mock_glBufferData, args);
- size_t count = size/sizeof(lua_Number);
- lua_Number *numbers = data;
+ size_t count = size/sizeof(float);
+ float *numbers = data;
for (int i=0; i<count; i++) {
- lily_store_value(mock_glBufferData, lua_Number, numbers[i]);
+ lily_store_value(mock_glBufferData, float, numbers[i]);
}
}
@@ -151,15 +151,15 @@ void gl_buffer_data_works()
};
lily_mock_get_call(mock_glBufferData, args, 0);
lily_assert_int_equal(target, GL_ARRAY_BUFFER);
- lily_assert_int_equal(size, 3*sizeof(lua_Number));
+ lily_assert_int_equal(size, 3*sizeof(float));
lily_assert_int_equal(usage, GL_STATIC_DRAW);
- lua_Number n;
- lily_get_value(mock_glBufferData, lua_Number, &n);
+ float n;
+ lily_get_value(mock_glBufferData, float, &n);
lily_assert_float_equal(n, 22, 0.1);
- lily_get_value(mock_glBufferData, lua_Number, &n);
+ lily_get_value(mock_glBufferData, float, &n);
lily_assert_float_equal(n, 33, 0.1);
- lily_get_value(mock_glBufferData, lua_Number, &n);
+ lily_get_value(mock_glBufferData, float, &n);
lily_assert_float_equal(n, 44, 0.1);
}