[MAGNOLIA-2310] GZipFilterTest test incorrectly uses int literal for a newline length count Created: 11/Aug/08  Updated: 23/Jan/13  Resolved: 12/Aug/08

Status: Closed
Project: Magnolia
Component/s: cache
Affects Version/s: 3.6.1
Fix Version/s: 3.6.2, 3.6.3

Type: Bug Priority: Minor
Reporter: Julian Frank Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

windows


Attachments: File GZipFilterTest.diff    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

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);
    }
    }


 Comments   
Comment by Magnolia International [ 12/Aug/08 ]

Haaa, awesome, thanks ! Somebody reported this on the users list but had no time to investigate yet. Patch applied, thanks !

Generated at Mon Feb 12 03:35:28 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.