| 84 | } |
| 85 | |
| 86 | TEST(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 |
nothing calls this directly
no test coverage detected