소스 검색

Fix dumb bug in unittests.

svn:r3409
Nick Mathewson 21 년 전
부모
커밋
1dc4d9a0ce
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/or/test.c

+ 2 - 2
src/or/test.c

@@ -808,7 +808,7 @@ test_gzip(void)
                                    GZIP_METHOD));
                                    GZIP_METHOD));
     test_assert(buf2);
     test_assert(buf2);
     test_assert(!memcmp(buf2, "\037\213", 2)); /* Gzip magic. */
     test_assert(!memcmp(buf2, "\037\213", 2)); /* Gzip magic. */
-    test_eq(detect_compression_method(buf2, strlen(buf1)), GZIP_METHOD);
+    test_eq(detect_compression_method(buf2, len1), GZIP_METHOD);
 
 
     test_assert(!tor_gzip_uncompress(&buf3, &len2, buf2, len1, GZIP_METHOD));
     test_assert(!tor_gzip_uncompress(&buf3, &len2, buf2, len1, GZIP_METHOD));
     test_assert(buf3);
     test_assert(buf3);
@@ -822,7 +822,7 @@ test_gzip(void)
                                  ZLIB_METHOD));
                                  ZLIB_METHOD));
   test_assert(buf2);
   test_assert(buf2);
   test_assert(!memcmp(buf2, "\x78\xDA", 2)); /* deflate magic. */
   test_assert(!memcmp(buf2, "\x78\xDA", 2)); /* deflate magic. */
-  test_eq(detect_compression_method(buf2, strlen(buf1)), ZLIB_METHOD);
+  test_eq(detect_compression_method(buf2, len1), ZLIB_METHOD);
 
 
   test_assert(!tor_gzip_uncompress(&buf3, &len2, buf2, len1, ZLIB_METHOD));
   test_assert(!tor_gzip_uncompress(&buf3, &len2, buf2, len1, ZLIB_METHOD));
   test_assert(buf3);
   test_assert(buf3);