Add comments to first test
authorJonathan Dieter <jdieter@gmail.com>
Tue, 24 Apr 2018 06:19:30 +0000 (09:19 +0300)
committerJonathan Dieter <jdieter@gmail.com>
Tue, 24 Apr 2018 06:19:30 +0000 (09:19 +0300)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
test/empty.c

index 1c6fca6949bf485fe25982a5dacf52036dc26ad2..23badd02fdf9768e08586a64d0b5a63859caa4b8 100644 (file)
@@ -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);