MCPcopy Create free account
hub / github.com/OSGeo/PROJ / TestThread

Function TestThread

src/tests/multistresstest.cpp:122–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120/************************************************************************/
121
122static void TestThread()
123
124{
125 int i, test_count = sizeof(test_list) / sizeof(TestItem);
126 int repeat_count = num_iterations;
127 int i_iter;
128
129 /* -------------------------------------------------------------------- */
130 /* Initialize coordinate system definitions. */
131 /* -------------------------------------------------------------------- */
132 PJ **pj_list;
133 PJ_CONTEXT *ctx = proj_context_create();
134
135 pj_list = (PJ **)calloc(test_count, sizeof(PJ *));
136
137 if (!reinit_every_iteration) {
138 for (i = 0; i < test_count; i++) {
139 TestItem *test = test_list + i;
140
141 pj_list[i] = proj_create_crs_to_crs(ctx, test->src_def,
142 test->dst_def, nullptr);
143 }
144 }
145
146 /* -------------------------------------------------------------------- */
147 /* Perform tests - over and over. */
148 /* -------------------------------------------------------------------- */
149
150 for (i_iter = 0; i_iter < repeat_count; i_iter++) {
151 for (i = 0; i < test_count; i++) {
152 TestItem *test = test_list + i;
153
154 if (reinit_every_iteration) {
155 proj_context_use_proj4_init_rules(nullptr, true);
156 pj_list[i] = proj_create_crs_to_crs(ctx, test->src_def,
157 test->dst_def, nullptr);
158
159 {
160 int skipTest = (pj_list[i] == nullptr);
161
162 if (skipTest != test->skip)
163 fprintf(
164 stderr,
165 "Threaded projection initialization does not match "
166 "unthreaded initialization\n");
167
168 if (skipTest) {
169 proj_destroy(pj_list[i]);
170 continue;
171 }
172 }
173 }
174
175 if (test->skip)
176 continue;
177
178 PJ_COORD out = proj_trans(pj_list[i], PJ_FWD, test->src);
179

Callers 2

WinTestThreadFunction · 0.85
PosixTestThreadFunction · 0.85

Calls 8

proj_context_createFunction · 0.85
proj_create_crs_to_crsFunction · 0.85
proj_destroyFunction · 0.85
proj_transFunction · 0.85
proj_errnoFunction · 0.85
proj_errno_resetFunction · 0.85
proj_context_destroyFunction · 0.85

Tested by

no test coverage detected