Go to the documentation of this file.
13 for (
size_t i=0;
i<
h;
i++){
14 for (
size_t j=0;
j<w;
j++){
15 t1[
i][
j] = (
i * w) +
j;
18 for (
size_t i=0;
i<
h;
i++){
19 for (
size_t j=0;
j<w;
j++){
20 ck_assert_int_eq(t1[
i][
j], (
i * w) +
j);
28 Suite *
s = suite_create(
"Stub");
30 TCase *tc_core = tcase_create(
"Core");
31 tcase_add_test(tc_core, allocate2d);
32 suite_add_tcase(
s, tc_core);
41 SRunner *sr = srunner_create(
s);
43 srunner_run_all(sr, CK_VERBOSE);
44 number_failed = srunner_ntests_failed(sr);
46 return (number_failed == 0) ?
EXIT_SUCCESS : EXIT_FAILURE;
END_TEST Suite * stub_suite(void)
int main(int argc, char **argv)
void free2d_char(char **p)
Free a two-dimensional array created by allocate2d_char.
Utility functions for allocating and freeing two-dimensional arrays of various types.
char ** allocate2d_char(size_t h, size_t w)
Allocate a two-dimensional array of type char of a given size.