1.1 --- a/tests/dstest_block_client.cc Fri Sep 16 22:08:44 2022 +0200
1.2 +++ b/tests/dstest_block_client.cc Fri Sep 16 22:49:39 2022 +0200
1.3 @@ -44,7 +44,7 @@
1.4 offset_t remaining = file_populated_span(file) - offset;
1.5 offset_t sample_remaining = remaining < sample ? remaining : sample;
1.6
1.7 - printf("%ld bytes from %p...\n", sample_remaining, (file->memory + offset));
1.8 + printf("%lld bytes from %p...\n", sample_remaining, (file->memory + offset));
1.9 memcpy(buf, (file->memory + offset), sample_remaining);
1.10 buf[sample_remaining] = '\0';
1.11
1.12 @@ -70,10 +70,10 @@
1.13
1.14 printf("----\n%s\n----\n", outbuf);
1.15
1.16 - printf("[%ld zero bytes at start]\n", leading);
1.17 - printf("[%ld bytes shown]\n", strlen(outbuf));
1.18 - printf("[%ld bytes after string]\n", sample_remaining - leading - strlen(outbuf));
1.19 - printf("[%ld zero bytes at end]\n", trailing);
1.20 + printf("[%lld zero bytes at start]\n", leading);
1.21 + printf("[%d bytes shown]\n", strlen(outbuf));
1.22 + printf("[%lld bytes after string]\n", sample_remaining - leading - strlen(outbuf));
1.23 + printf("[%lld zero bytes at end]\n", trailing);
1.24 }
1.25 }
1.26
1.27 @@ -120,7 +120,7 @@
1.28 return 1;
1.29 }
1.30
1.31 - printf("Region %ld...%ld populated size %ld size %ld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.32 + printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.33 printf("File contents:\n");
1.34
1.35 show(&file, step, sample);
1.36 @@ -128,7 +128,7 @@
1.37 printf("File shown.\n");
1.38 printf("Expected...\n"
1.39 "[0 zero bytes at start]\n"
1.40 - "[%ld bytes shown]\n"
1.41 + "[%lld bytes shown]\n"
1.42 "[0 bytes after string]\n"
1.43 "[0 zero bytes at end]\n\n",
1.44 original_size);
1.45 @@ -144,7 +144,7 @@
1.46 return 1;
1.47 }
1.48
1.49 - printf("Region %ld...%ld populated size %ld size %ld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.50 + printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.51 printf("File contents:\n");
1.52
1.53 show(&file, step, sample);
1.54 @@ -152,10 +152,10 @@
1.55 printf("File shown.\n");
1.56 printf("Expected...\n"
1.57 "[10 zero bytes at start]\n"
1.58 - "[%ld bytes shown]\n"
1.59 - "[%ld bytes after string]\n"
1.60 - "[%ld zero bytes at end]\n\n",
1.61 - original_size - 20, 10UL, 10UL);
1.62 + "[%lld bytes shown]\n"
1.63 + "[%lld bytes after string]\n"
1.64 + "[%lld zero bytes at end]\n\n",
1.65 + original_size - 20, 10ULL, 10ULL);
1.66
1.67 /* Resizing must occur before writing beyond the end of file. Otherwise, the
1.68 data may get discarded if the supporting flexpage needs to be flushed. */
1.69 @@ -166,7 +166,7 @@
1.70 offset_t new_size = old_populated_size_rounded + old_populated_size;
1.71 offset_t new_region = round(new_size, page(1));
1.72
1.73 - printf("Resize to %ld...\n", new_size);
1.74 + printf("Resize to %lld...\n", new_size);
1.75
1.76 err = file_resize(&file, new_size);
1.77
1.78 @@ -177,8 +177,8 @@
1.79 }
1.80
1.81 printf("Resized file...\n");
1.82 - printf("Region %ld...%ld populated size %ld size %ld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.83 - printf("Expected %ld...%ld populated size %ld size %ld.\n\n", 0UL, old_populated_size_rounded, old_populated_size_rounded, new_size);
1.84 + printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.85 + printf("Expected %lld...%lld populated size %lld size %lld.\n\n", 0ULL, old_populated_size_rounded, old_populated_size_rounded, new_size);
1.86
1.87 /* Re-map to avoid masking the region. */
1.88
1.89 @@ -191,10 +191,10 @@
1.90 }
1.91
1.92 printf("Remapped file without masking...\n");
1.93 - printf("Region %ld...%ld populated size %ld size %ld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.94 - printf("Expected %ld...%ld populated size %ld size %ld.\n\n", 0UL, new_region, old_populated_size, old_size);
1.95 + printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.96 + printf("Expected %lld...%lld populated size %lld size %lld.\n\n", 0ULL, new_region, old_populated_size, old_size);
1.97
1.98 - printf("Resize to %ld...\n", new_size);
1.99 + printf("Resize to %lld...\n", new_size);
1.100
1.101 err = file_resize(&file, new_size);
1.102
1.103 @@ -205,16 +205,16 @@
1.104 }
1.105
1.106 printf("Resized file...\n");
1.107 - printf("Region %ld...%ld populated size %ld size %ld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.108 - printf("Expected %ld...%ld populated size %ld size %ld.\n\n", 0UL, round(new_size, page(1)), new_size, new_size);
1.109 + printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.110 + printf("Expected %lld...%lld populated size %lld size %lld.\n\n", 0ULL, round(new_size, page(1)), new_size, new_size);
1.111
1.112 /* Copy the file data to another file region. */
1.113
1.114 - printf("Copy data to %ld...\n", old_populated_size_rounded);
1.115 + printf("Copy data to %lld...\n", old_populated_size_rounded);
1.116
1.117 memcpy(file.memory + old_populated_size_rounded, file.memory, old_size);
1.118
1.119 - printf("Region %ld...%ld populated size %ld size %ld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.120 + printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.121 printf("File contents:\n");
1.122
1.123 show(&file, step, sample);
1.124 @@ -222,12 +222,12 @@
1.125 printf("File shown.\n");
1.126 printf("Expected...\n"
1.127 "[0 zero bytes at start]\n"
1.128 - "[%ld bytes shown]\n"
1.129 - "[%ld bytes after string]\n"
1.130 - "[%ld zero bytes at end]\n"
1.131 + "[%lld bytes shown]\n"
1.132 + "[%lld bytes after string]\n"
1.133 + "[%lld zero bytes at end]\n"
1.134 "...\n"
1.135 "[0 zero bytes at start]\n"
1.136 - "[%ld bytes shown]\n"
1.137 + "[%lld bytes shown]\n"
1.138 "[0 bytes after string]\n"
1.139 "[0 zero bytes at end]\n\n",
1.140 original_size, sample - original_size, sample - original_size,
1.141 @@ -243,7 +243,7 @@
1.142 return 1;
1.143 }
1.144
1.145 - printf("Region %ld...%ld populated size %ld size %ld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.146 + printf("Region %lld...%lld populated size %lld size %lld.\n", file.start_pos, file.end_pos, file_populated_span(&file), file.size);
1.147 printf("File contents:\n");
1.148
1.149 show(&file, step, sample);
1.150 @@ -251,12 +251,12 @@
1.151 printf("File shown.\n");
1.152 printf("Expected...\n"
1.153 "[10 zero bytes at start]\n"
1.154 - "[%ld bytes shown]\n"
1.155 - "[%ld bytes after string]\n"
1.156 - "[%ld zero bytes at end]\n"
1.157 + "[%lld bytes shown]\n"
1.158 + "[%lld bytes after string]\n"
1.159 + "[%lld zero bytes at end]\n"
1.160 "...\n"
1.161 "[0 zero bytes at start]\n"
1.162 - "[%ld bytes shown]\n"
1.163 + "[%lld bytes shown]\n"
1.164 "[10 bytes after string]\n"
1.165 "[10 zero bytes at end]\n",
1.166 original_size - 10, sample - original_size, sample - original_size,
2.1 --- a/tests/dstest_file_client.cc Fri Sep 16 22:08:44 2022 +0200
2.2 +++ b/tests/dstest_file_client.cc Fri Sep 16 22:49:39 2022 +0200
2.3 @@ -44,7 +44,7 @@
2.4
2.5 offset_t nwritten = client_write(file, buffer, size);
2.6
2.7 - printf("Written %ld/%ld in #%d to file with first %c, last %c...\n", nwritten, size, region, *buffer, *(buffer + nwritten - 1));
2.8 + printf("Written %lld/%lld in #%d to file with first %c, last %c...\n", nwritten, size, region, *buffer, *(buffer + nwritten - 1));
2.9
2.10 /* Flush to make the output available. */
2.11
2.12 @@ -71,7 +71,7 @@
2.13
2.14 client_seek(file, 0, SEEK_END);
2.15
2.16 - printf("File %s at position %ld...\n", creator ? "creator" : "follower", client_tell(file));
2.17 + printf("File %s at position %lld...\n", creator ? "creator" : "follower", client_tell(file));
2.18
2.19 /* Write initial data as the file's creator. */
2.20
2.21 @@ -105,11 +105,11 @@
2.22 {
2.23 total += nread;
2.24
2.25 - printf("Read as %s %ld/%ld, total %ld, first %c, last %c, from file...\n", creator ? "creator" : "follower",
2.26 + printf("Read as %s %lld/%lld, total %lld, first %c, last %c, from file...\n", creator ? "creator" : "follower",
2.27 nread, size, total, *buffer, *(buffer + nread - 1));
2.28
2.29 if (!(*(buffer + nread - 1)))
2.30 - printf("Warning: length before zero region is %ld\n", strlen(buffer));
2.31 + printf("Warning: length before zero region is %lld\n", strlen(buffer));
2.32
2.33 nread = client_read(file, buffer, size);
2.34 }
4.1 --- a/tests/dstest_pipe_client.cc Fri Sep 16 22:08:44 2022 +0200
4.2 +++ b/tests/dstest_pipe_client.cc Fri Sep 16 22:49:39 2022 +0200
4.3 @@ -64,7 +64,7 @@
4.4
4.5 offset_t nwritten = client_write(writer, buffer, TO_TRANSFER);
4.6
4.7 - printf("Written %ld/%ld in #%d of %d/%d to pipe #%d...\n", nwritten, TO_TRANSFER, region, loop, 2, number);
4.8 + printf("Written %lld/%lld in #%d of %d/%d to pipe #%d...\n", nwritten, TO_TRANSFER, region, loop, 2, number);
4.9 }
4.10
4.11 sleep(1);
4.12 @@ -130,7 +130,7 @@
4.13 {
4.14 totals[p] += nread;
4.15
4.16 - printf("Read %ld/%ld, total %ld, first %c, last %c, from pipe #%d...\n", nread, TO_TRANSFER, totals[p], *buffer, *(buffer + nread - 1), p + 1);
4.17 + printf("Read %lld/%lld, total %lld, first %c, last %c, from pipe #%d...\n", nread, TO_TRANSFER, totals[p], *buffer, *(buffer + nread - 1), p + 1);
4.18 nread = client_read(reader, buffer, TO_TRANSFER);
4.19 }
4.20
4.21 @@ -151,7 +151,7 @@
4.22
4.23 for (int p = 0; p < 2; p++)
4.24 {
4.25 - printf("Data received for pipe #%d: %ld\n", p, totals[p]);
4.26 + printf("Data received for pipe #%d: %lld\n", p, totals[p]);
4.27 printf("Data shown for pipe #%d: %s\n", p, totals[p] == TO_TRANSFER * 26 * NUMBER_OF_ITERATIONS ? "True" : "False");
4.28 }
4.29 }
4.30 @@ -160,6 +160,8 @@
4.31 {
4.32 /* Obtain pipe endpoint references. Blocking will be set up manually. */
4.33
4.34 + printf("Obtaining pipes...\n");
4.35 +
4.36 file_t *reader1, *reader2, *writer1, *writer2;
4.37 long err = client_pipe(&reader1, &writer1, O_NONBLOCK) ||
4.38 client_pipe(&reader2, &writer2, O_NONBLOCK);
4.39 @@ -170,6 +172,8 @@
4.40 return 1;
4.41 }
4.42
4.43 + printf("Starting activities...\n");
4.44 +
4.45 /* Schedule reader and writer threads. */
4.46
4.47 std::thread *activities[3];