MCPcopy Create free account
hub / github.com/OSGeo/gdal / TEST

Function TEST

autotest/cpp/bug1488.cpp:86–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86TEST(bug1488, test)
87{
88 GDALAllRegister();
89
90 hTIFFDrv = GDALGetDriverByName("GTiff");
91 if (!hTIFFDrv)
92 {
93 GTEST_SKIP() << "GTIFF driver missing";
94 }
95 else
96 {
97 const char *pszCO =
98 GDALGetMetadataItem(hTIFFDrv, GDAL_DMD_CREATIONOPTIONLIST, nullptr);
99 if (pszCO == nullptr || strstr(pszCO, "WEBP") == nullptr)
100 {
101 GTEST_SKIP() << "WEBP driver missing";
102 }
103 else
104 {
105 GDALSetCacheMax(30 * 1000 * 1000);
106
107 CPLSetErrorHandler(myErrorHandler);
108
109 VSISync(szSrcDataset, "/vsimem/thread1.tif", nullptr, nullptr,
110 nullptr, nullptr);
111
112 CPLJoinableThread *t1 =
113 CPLCreateJoinableThread(worker_thread1, nullptr);
114 CPLJoinableThread *t2 =
115 CPLCreateJoinableThread(worker_thread2, nullptr);
116 int nCountSeconds = 0;
117 while (!bThread1Finished && !bThread2Finished)
118 {
119 CPLSleep(1);
120 nCountSeconds++;
121 if (nCountSeconds == 2)
122 {
123 /* After 2 seconds without errors, assume no threading issue, and */
124 /* early exit */
125 bContinue = FALSE;
126 }
127 }
128 CPLJoinThread(t1);
129 CPLJoinThread(t2);
130 }
131 }
132}
133
134} // namespace

Callers

nothing calls this directly

Calls 4

VSISyncFunction · 0.85
CPLCreateJoinableThreadFunction · 0.85
CPLSleepFunction · 0.85
CPLJoinThreadFunction · 0.85

Tested by

no test coverage detected