{"thread":{"id":"17828","subject":"[JGIT PATCH 1/1] Invalid test preventing a build using maven","startedAt":"2009-02-16T17:46:31Z","lastAt":"2009-02-16T18:05:23Z","messageCount":2,"participants":["Constantine Plotnikov","Sverre Rabbelier"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"104983","messageId":"85647ef50902160946m480542a3m1511366f6cafe04e@mail.gmail.com","threadId":"17828","inReplyTo":null,"subject":"[JGIT PATCH 1/1] Invalid test preventing a build using maven","fromName":"Constantine Plotnikov","fromEmail":"constantine.plotnikov@gmail.com","sentAt":"2009-02-16T17:46:31Z","receivedAt":"2009-02-16T17:46:31Z","isPatch":true,"sender":{"key":"constantine.plotnikov@gmail.com","avatar":null},"body":"I have tried to build jgit using maven on Windows and build failed due\nto the failed test. The test\nQuotedStringGitPathStyleTest.testDequote_OctalAll was dependent on the\nsystem charset. If the test is run with -Dfile.encoding=Cp1251 under\neclipse, it failed as well.\n\nThis was cased that by the fact that corresponding test generated\ninvalid UTF-8 character sequence for code points U+80 - U+FF. In that\ncase the method RawParseUtils.decodeNoFallback fall backs to the\ndefault system encoding that is Cp1251 in my environment.\n\nThe attached patch ensures that correct UTF-8 character sequence is\nused in the test.\n\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/util/QuotedStringGitPathStyleTest.java\nb/org.spearce.jgit.test/tst/org/spearce/jgit/util/QuotedStringGitPathStyleTest.java\nindex 54fbd31..7d29f21 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/util/QuotedStringGitPathStyleTest.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/util/QuotedStringGitPathStyleTest.java\n@@ -127,13 +127,22 @@ public void testDequote_NamedEscapes() {\n \t}\n\n \tpublic void testDequote_OctalAll() {\n-\t\tfor (int i = 0; i < 256; i++) {\n-\t\t\tString s = Integer.toOctalString(i);\n-\t\t\twhile (s.length() < 3) {\n-\t\t\t\ts = \"0\" + s;\n-\t\t\t}\n-\t\t\tassertDequote(\"\" + (char) i, \"\\\\\" + s);\n+\t\tfor (int i = 0; i < 127; i++) {\n+\t\t\tassertDequote(\"\" + (char) i, octalEscape(i));\n \t\t}\n+\t\tfor (int i = 128; i < 256; i++) {\n+\t\t\tint f = 0xC0 | (i >> 6);\n+\t\t\tint s = 0x80 | (i & 0x3f);\n+\t\t\tassertDequote(\"\" + (char) i, octalEscape(f)+octalEscape(s));\n+\t\t}\n+\t}\n+\n+\tprivate String octalEscape(int i) {\n+\t\tString s = Integer.toOctalString(i);\n+\t\twhile (s.length() < 3) {\n+\t\t\ts = \"0\" + s;\n+\t\t}\n+\t\treturn \"\\\\\"+s;\n \t}\n\n \tpublic void testQuote_OctalAll() {\n"},{"id":"104985","messageId":"bd6139dc0902161005x32e6ddccs8cbf9a825fa26c50@mail.gmail.com","threadId":"17828","inReplyTo":"85647ef50902160946m480542a3m1511366f6cafe04e@mail.gmail.com","subject":"Re: [JGIT PATCH 1/1] Invalid test preventing a build using maven","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-02-16T18:05:23Z","receivedAt":"2009-02-16T18:05:23Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Mon, Feb 16, 2009 at 18:46, Constantine Plotnikov\n<constantine.plotnikov@gmail.com> wrote:\n> The attached patch ensures that correct UTF-8 character sequence is\n> used in the test.\n\nPlease follow the guidelines to submitting patches as described in\nDocumentation/SubmittingPatches (available online at [0]). Doing so\nwill save the maintainer (in this case Shawn) the time required to\nmunge your patch into an applyable format. Also, your commit message\nis funny in the sense that part of it should go into the actual commit\nmessage, and part of it should go after the triple dashes (also\ndescribed in SubmittingPatches).\n\nGood luck :).\n\n[0] http://repo.or.cz/w/git.git?a=blob_plain;f=Documentation/SubmittingPatches;hb=HEAD\n\n-- \nCheers,\n\nSverre Rabbelier\n"}]}