Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-2310

GZipFilterTest test incorrectly uses int literal for a newline length count

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.6.2, 3.6.3
    • 3.6.1
    • cache
    • None
    • windows

      Newline should be derived, not hard coded. It isn't 1 on windows.

      I included the diff here, and attached it.

      Index: GZipFilterTest.java
      ===================================================================
      — GZipFilterTest.java (revision 17249)
      +++ GZipFilterTest.java (working copy)
      @@ -107,7 +107,7 @@
      final byte[] compressedBytes = finalOutput.toByteArray();
      assertTrue("output should be gzipped", GZipUtil.isGZipped(compressedBytes));
      final byte[] uncompressed = GZipUtil.ungzip(compressedBytes);

      • final int expectedLength = iterations * (SOME_10CHARSLONG_CHAIN.length() + 1); // n chars + newline
        + final int expectedLength = iterations * (SOME_10CHARSLONG_CHAIN.length() + System.getProperty("line.separator").length()); // n chars + newline
        assertEquals(expectedLength, uncompressed.length);
        }
        }

        Acceptance criteria

              gjoseph Magnolia International
              jfrank Julian Frank
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD