1.1 --- a/tests/dstest_file_remove.cc Thu Sep 01 21:40:39 2022 +0200
1.2 +++ b/tests/dstest_file_remove.cc Thu Sep 01 21:52:41 2022 +0200
1.3 @@ -84,8 +84,9 @@
1.4
1.5 file = client_open(filename, O_RDONLY);
1.6
1.7 - if (file == NULL)
1.8 + if (!client_opened(file))
1.9 {
1.10 + client_close(file);
1.11 printf("Could not open file: %s\n", filename);
1.12 return 1;
1.13 }
1.14 @@ -112,7 +113,7 @@
1.15
1.16 file_t *file_new = client_open(filename, O_RDONLY);
1.17
1.18 - if (file_new != NULL)
1.19 + if (client_opened(file_new))
1.20 {
1.21 printf("File should be absent: %s\n", filename);
1.22 return 1;
1.23 @@ -120,8 +121,9 @@
1.24
1.25 file_new = client_open(filename, O_RDWR | O_CREAT);
1.26
1.27 - if (file_new == NULL)
1.28 + if (!client_opened(file_new))
1.29 {
1.30 + client_close(file_new);
1.31 printf("File should be present: %s\n", filename);
1.32 return 1;
1.33 }
1.34 @@ -138,8 +140,7 @@
1.35 client_close(file);
1.36 client_close(file_new);
1.37
1.38 - printf("End of tests.\n");
1.39 -
1.40 + printf("End of test.\n");
1.41 return 0;
1.42 }
1.43