From 5ab6115f9fcceef5aa96f41d89b61a9019eab3aa Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Tue, 24 Apr 2018 09:19:30 +0300 Subject: [PATCH] Add comments to first test Signed-off-by: Jonathan Dieter --- test/empty.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/empty.c b/test/empty.c index 1c6fca6..23badd0 100644 --- a/test/empty.c +++ b/test/empty.c @@ -39,6 +39,7 @@ static char *checksum="42590fea6f55aca71e222ebe2d147ed89d17aac951a997fef8b980b2803a0412"; int main (int argc, char *argv[]) { + /* Create empty zchunk file */ int out = open("empty.zck", O_WRONLY | O_CREAT | O_TRUNC, 0666); if(out < 0) { perror("Unable to open empty.zck for writing"); @@ -52,6 +53,8 @@ int main (int argc, char *argv[]) { exit(1); close(out); zck_free(&zck); + + /* Open zchunk file and check that checksum matches */ int in = open("empty.zck", O_RDONLY); if(in < 0) { perror("Unable to open empty.zck for reading"); @@ -74,6 +77,8 @@ int main (int argc, char *argv[]) { printf("Expected checksum: (SHA-256)%s\n", checksum); exit(1); } + + /* Go back to beginning of file and read data from it */ if(lseek(in, 0, SEEK_SET) != 0) { perror("Unable to seek to beginning of empty.zck"); exit(1); -- 2.30.2