MCPcopy Create free account
hub / github.com/OpenPrinting/cups / main

Function main

cups/testarray.c:33–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 */
32
33int /* O - Exit status */
34main(void)
35{
36 int i; /* Looping var */
37 cups_array_t *array, /* Test array */
38 *dup_array; /* Duplicate array */
39 int status; /* Exit status */
40 char *text; /* Text from array */
41 char word[256]; /* Word from file */
42 double start, /* Start time */
43 end; /* End time */
44 cups_dir_t *dir; /* Current directory */
45 cups_dentry_t *dent; /* Directory entry */
46 char *saved[32]; /* Saved entries */
47 void *data; /* User data for arrays */
48
49
50 /*
51 * No errors so far...
52 */
53
54 status = 0;
55
56 /*
57 * cupsArrayNew()
58 */
59
60 fputs("cupsArrayNew: ", stdout);
61
62 data = (void *)"testarray";
63 array = cupsArrayNew((cups_array_func_t)strcmp, data);
64
65 if (array)
66 puts("PASS");
67 else
68 {
69 puts("FAIL (returned NULL, expected pointer)");
70 status ++;
71 }
72
73 /*
74 * cupsArrayUserData()
75 */
76
77 fputs("cupsArrayUserData: ", stdout);
78 if (cupsArrayUserData(array) == data)
79 puts("PASS");
80 else
81 {
82 printf("FAIL (returned %p instead of %p!)\n", cupsArrayUserData(array),
83 data);
84 status ++;
85 }
86
87 /*
88 * cupsArrayAdd()
89 */
90

Callers

nothing calls this directly

Calls 15

cupsArrayNewFunction · 0.85
cupsArrayUserDataFunction · 0.85
cupsArrayAddFunction · 0.85
cupsArrayCountFunction · 0.85
cupsArrayFirstFunction · 0.85
cupsArrayNextFunction · 0.85
cupsArrayLastFunction · 0.85
cupsArrayPrevFunction · 0.85
cupsArrayFindFunction · 0.85
cupsArrayCurrentFunction · 0.85
cupsArrayDupFunction · 0.85
cupsArrayRemoveFunction · 0.85

Tested by

no test coverage detected