Greenbone Vulnerability Management Libraries 22.32.0
array_tests.c File Reference
#include "array.c"
#include <cgreen/cgreen.h>
#include <cgreen/mocks.h>
Include dependency graph for array_tests.c:

Go to the source code of this file.

Functions

 Describe (array)
 BeforeEach (array)
 AfterEach (array)
 Ensure (array, make_array_never_returns_null)
int main (int argc, char **argv)

Function Documentation

◆ AfterEach()

AfterEach ( array )

Definition at line 15 of file array_tests.c.

16{
17}

◆ BeforeEach()

BeforeEach ( array )

Definition at line 12 of file array_tests.c.

13{
14}

◆ Describe()

Describe ( array )

◆ Ensure()

Ensure ( array ,
make_array_never_returns_null  )

Definition at line 21 of file array_tests.c.

22{
23 array_t *array;
24
25 array = make_array ();
26 assert_that (array, is_not_null);
27 array_free (array);
28}
GPtrArray * make_array(void)
Make a global array.
Definition array.c:25
void array_free(GPtrArray *array)
Free global array value.
Definition array.c:50
GPtrArray array_t
Definition array.h:16

References array_free(), and make_array().

Here is the call graph for this function:

◆ main()

int main ( int argc,
char ** argv )

Definition at line 33 of file array_tests.c.

34{
35 int ret;
36 TestSuite *suite;
37
38 suite = create_test_suite ();
39
40 add_test_with_context (suite, array, make_array_never_returns_null);
41
42 if (argc > 1)
43 ret = run_single_test (suite, argv[1], create_text_reporter ());
44 else
45 ret = run_test_suite (suite, create_text_reporter ());
46
47 destroy_test_suite (suite);
48
49 return ret;
50}