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

Function test1

autotest/cpp/testblockcachewrite.cpp:80–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80static void test1()
81{
82 CPLJoinableThread *hThread;
83
84 printf("Start test1\n");
85 printf("main thread %p\n", (void *)CPLGetPID());
86
87 GDALSetCacheMax(0);
88
89 MyDataset *poDS = new MyDataset();
90
91 char buf1[] = {1};
92 CPL_IGNORE_RET_VAL(GDALRasterIO(GDALGetRasterBand(poDS, 1), GF_Write, 0, 0,
93 1, 1, buf1, 1, 1, GDT_Byte, 0, 0));
94
95 hThread = CPLCreateJoinableThread(thread_func1, nullptr);
96 CPLSleep(0.3);
97 CPL_IGNORE_RET_VAL(GDALRasterIO(GDALGetRasterBand(poDS, 1), GF_Write, 1, 0,
98 1, 1, buf1, 1, 1, GDT_Byte, 0, 0));
99 GDALFlushCacheBlock();
100
101 CPLJoinThread(hThread);
102
103 delete poDS;
104 printf("End test1\n");
105}
106
107static void thread_func2(void * /* unused */)
108{

Callers 1

TESTFunction · 0.85

Calls 5

CPLGetPIDFunction · 0.85
CPLCreateJoinableThreadFunction · 0.85
CPLSleepFunction · 0.85
CPLJoinThreadFunction · 0.85
CPL_IGNORE_RET_VALFunction · 0.50

Tested by

no test coverage detected