MCPcopy Index your code
hub / github.com/MapServer/MapServer / main

Function main

testcopy.c:36–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34void printAtts(mapObj*, const char*);
35
36int main(int argc, char *argv[]) {
37
38 mapObj *original_map, *clone_map;
39
40 /* ---------------------------------------------------------------------
41 * Test 1: free original before freeing clone
42 * --------------------------------------------------------------------- */
43
44 /* Load map file */
45 original_map = msLoadMap("tests/test.map", NULL);
46
47 if (original_map == NULL)
48 {
49 /* Write errors */
50 msWriteError(stderr);
51 msResetErrorList();
52 exit(0);
53 }
54
55 /* Dump out some attributes */
56 printAtts(original_map, "Original");
57
58 /* Clone it */
59 clone_map = msNewMapObj();
60 msCopyMap(clone_map, original_map);
61
62 /* Write errors */
63 msWriteError(stderr);
64 msResetErrorList();
65
66 /* Free */
67 msFreeMap(original_map);
68
69 /* Dump clone's attributes */
70 printAtts(clone_map, "Clone");
71
72 /* Free clone */
73 msFreeMap(clone_map);
74
75 exit(0);
76}
77
78void printAtts(mapObj *map, const char *title) {
79 printf("\n%s Attributes\n----------------------\n", title);

Callers

nothing calls this directly

Calls 6

msWriteErrorFunction · 0.85
msResetErrorListFunction · 0.85
printAttsFunction · 0.85
msNewMapObjFunction · 0.85
msCopyMapFunction · 0.85
msFreeMapFunction · 0.85

Tested by

no test coverage detected