1.1 --- a/tests/dstest_block_client_simple.cc Fri Oct 28 01:32:32 2022 +0200
1.2 +++ b/tests/dstest_block_client_simple.cc Sat Oct 29 01:19:48 2022 +0200
1.3 @@ -20,6 +20,9 @@
1.4 */
1.5
1.6 #include <systypes/fcntl.h>
1.7 +#include <systypes/format.h>
1.8 +
1.9 +#define FMToffsetd "%" pFMToffset "d"
1.10
1.11 #include <stdio.h>
1.12 #include <stdlib.h>
1.13 @@ -62,7 +65,7 @@
1.14
1.15 if (nread != size)
1.16 {
1.17 - printf("Could not read entire file: %ld out of %ld bytes.\n", nread, size);
1.18 + printf("Could not read entire file: " FMToffsetd " out of " FMToffsetd " bytes.\n", nread, size);
1.19 return 1;
1.20 }
1.21
1.22 @@ -70,7 +73,7 @@
1.23
1.24 fwrite(buffer, sizeof(char), nread, stdout);
1.25
1.26 - printf("Copy %ld bytes to end...\n", nread);
1.27 + printf("Copy " FMToffsetd " bytes to end...\n", nread);
1.28
1.29 for (int times = 0; times < repetition; times++)
1.30 {
1.31 @@ -80,20 +83,20 @@
1.32
1.33 if (nwritten != nread)
1.34 {
1.35 - printf("Could not write file section: %ld instead of %ld bytes.\n",
1.36 + printf("Could not write file section: " FMToffsetd " instead of " FMToffsetd " bytes.\n",
1.37 nwritten, nread);
1.38 return 1;
1.39 }
1.40 }
1.41
1.42 - printf("File now has size %ld.\n", file->size);
1.43 - printf("File has expected size %ld: %s\n", new_size, new_size == file->size ? "True" : "False");
1.44 + printf("File now has size " FMToffsetd ".\n", file->size);
1.45 + printf("File has expected size " FMToffsetd ": %s\n", new_size, new_size == file->size ? "True" : "False");
1.46
1.47 printf("Seek to start...\n");
1.48
1.49 client_seek(file, 0, SEEK_SET);
1.50
1.51 - printf("At mapped region from %ld to %ld with data at %ld to %ld.\n",
1.52 + printf("At mapped region from " FMToffsetd " to " FMToffsetd " with data at " FMToffsetd " to " FMToffsetd ".\n",
1.53 file->start_pos, file->end_pos, file->data_current, file->data_end);
1.54
1.55 printf("File contents...\n");
1.56 @@ -104,7 +107,7 @@
1.57 {
1.58 if ((nread != size) && (nread != file->size - position))
1.59 {
1.60 - printf("Could not read file section: %ld instead of %ld or remaining %ld bytes.\n",
1.61 + printf("Could not read file section: " FMToffsetd " instead of " FMToffsetd " or remaining " FMToffsetd " bytes.\n",
1.62 nread, size, file->size - position);
1.63 return 1;
1.64 }