| 35 | } |
| 36 | |
| 37 | static void test_mmap_read(size_t off) |
| 38 | { |
| 39 | const char* filename = "local.map"; |
| 40 | acl::fstream fp; |
| 41 | if (!fp.open(filename, O_RDWR | O_CREAT, 0600)) |
| 42 | { |
| 43 | printf("open %s error %s\r\n", filename, acl::last_serror()); |
| 44 | return; |
| 45 | } |
| 46 | |
| 47 | size_t max_len = 1024 * 1024 * 500, init_len = 0; |
| 48 | acl::string buf(fp.file_handle(), max_len, init_len, off); |
| 49 | |
| 50 | char tmp[256]; |
| 51 | memcpy(tmp, buf.c_str(), sizeof(tmp) - 1); |
| 52 | tmp[sizeof(tmp) - 1] = 0; |
| 53 | printf("[%s]\r\n", tmp); |
| 54 | } |
| 55 | |
| 56 | static void test_mem(int max) |
| 57 | { |
no test coverage detected
searching dependent graphs…