]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed signed warnings in GZ unit tests.
authorNathan Moinvaziri <nathan@nathanm.com>
Mon, 6 Jun 2022 23:18:19 +0000 (16:18 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Tue, 7 Jun 2022 10:46:52 +0000 (12:46 +0200)
  test_gzio.cc(44): warning C4389: '!=': signed/unsigned mismatch
  test_gzio.cc(72): warning C4389: '!=': signed/unsigned mismatch

test/test_gzio.cc

index 46baa028eb5e85acdb987da5cd201fd26b833752..59e46f520a5cb54be6e620c129f97775f2ad6779 100644 (file)
@@ -41,7 +41,7 @@ TEST(gzip, readwrite) {
     EXPECT_GE(PREFIX(gzseek)(file, 1L, SEEK_CUR), 0);
     /* Write hello, hello! using gzfwrite using best compression level */
     EXPECT_EQ(PREFIX(gzsetparams)(file, Z_BEST_COMPRESSION, Z_DEFAULT_STRATEGY), Z_OK);
-    EXPECT_NE(PREFIX(gzfwrite)(hello, hello_len, 1, file), 0);
+    EXPECT_NE(PREFIX(gzfwrite)(hello, hello_len, 1, file), 0UL);
     /* Flush compressed bytes to file */
     EXPECT_EQ(PREFIX(gzflush)(file, Z_SYNC_FLUSH), Z_OK);
     compr_len = (uint32_t)PREFIX(gzoffset)(file);
@@ -69,7 +69,7 @@ TEST(gzip, readwrite) {
     /* Read first hello, hello! string with gzgets */
     strcpy((char*)uncompr, "garbages");
     PREFIX(gzgets)(file, (char*)uncompr, (int)uncompr_len);
-    EXPECT_EQ(strlen((char*)uncompr), 7); /* " hello!" */
+    EXPECT_EQ(strlen((char*)uncompr), 7UL); /* " hello!" */
     EXPECT_STREQ((char*)uncompr, hello + 6);
 
     /* Seek to second hello, hello! string */