Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[egit-dev] Re: patch/GetTextTest.testGetText_Convert() question

tisdag 13 oktober 2009 17:29:53 skrev  Shawn O. Pearce:
> Meinrad Recheis <meinrad.recheis@xxxxxxxxx> wrote:
> > I got a question about a test case that is failing on Windows *both*
> > in Java (see your CI server) and in C#. Of course we can not
> > completely exclude the possibility of a porting error. I am also not
> > an expert on encoding so I'd like to ask you something:
> >
> > If one changes the line
> >
> > exp = exp.replace("\303\205ngstr\303\266m", "\u00c5ngstr\u00f6m");

Apply this patch and run the test

diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/GetTextTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/GetTextTest.java
index f92affb..5e33a16 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/GetTextTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/GetTextTest.java
@@ -81,9 +81,20 @@ public void testGetText_Convert() throws IOException {
 		String exp = readTestPatchFile(csOld);
 		exp = exp.replace("\303\205ngstr\303\266m", "\u00c5ngstr\u00f6m");
 
+		for (Object k : System.getProperties().keySet())
+			System.out.println(k + " = '" + System.getProperty(k.toString()) + "'");
+		dump(exp);
+		dump(fh.getScriptText(csOld, csNew));
 		assertEquals(exp, fh.getScriptText(csOld, csNew));
 	}
 
+	private void dump(String exp) {
+		System.out.print("EXPR=");
+		for (int i=0; i < exp.length(); ++i)
+			System.out.format("%c (%x)", exp.charAt(i), exp.charAt(i)&0xFFFF);
+		System.out.println();
+	}
+
 	public void testGetText_DiffCc() throws IOException {
 		final Charset csOld = Charset.forName("ISO-8859-1");
 		final Charset csNew = Charset.forName("UTF-8");


I get this (works here!).

java.runtime.name = 'OpenJDK Runtime Environment'
sun.boot.library.path = '/usr/lib/jvm/java-6-openjdk/jre/lib/i386'
java.vm.version = '14.0-b08'
java.vm.vendor = 'Sun Microsystems Inc.'
java.vendor.url = 'http://java.sun.com/'
path.separator = ':'
java.vm.name = 'OpenJDK Server VM'
file.encoding.pkg = 'sun.io'
sun.java.launcher = 'SUN_STANDARD'
user.country = 'SE'
sun.os.patch.level = 'unknown'
java.vm.specification.name = 'Java Virtual Machine Specification'
user.dir = '/home/me/SW/JGIT/org.eclipse.jgit.test'
java.runtime.version = '1.6.0_0-b14'
java.awt.graphicsenv = 'sun.awt.X11GraphicsEnvironment'
java.endorsed.dirs = '/usr/lib/jvm/java-6-openjdk/jre/lib/endorsed'
os.arch = 'i386'
java.io.tmpdir = '/tmp'
line.separator = '
'
java.vm.specification.vendor = 'Sun Microsystems Inc.'
os.name = 'Linux'
sun.jnu.encoding = 'UTF-8'
java.library.path = '/usr/lib/jvm/java-6-openjdk/jre/lib/i386/server:/usr/lib/jvm/java-6-openjdk/jre/lib/i386:/usr/lib/jvm/java-6-openjdk/jre/../lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/client:/usr/lib/jvm/java-6-
sun-1.6.0.16/jre/lib/i386:/usr/lib/xulrunner-addons:/usr/lib/xulrunner-addons:/usr/java/packages/lib/i386:/lib:/usr/lib'
java.specification.name = 'Java Platform API Specification'
java.class.version = '50.0'
sun.management.compiler = 'HotSpot Tiered Compilers'
os.version = '2.6.28-11-generic'
user.home = '/home/me'
user.zoneinfo.dir = '/usr/share/javazi'
user.timezone = ''
java.awt.printerjob = 'sun.print.PSPrinterJob'
file.encoding = 'UTF-8'
java.specification.version = '1.6'
java.class.path = 
'/home/me/SW/JGIT/org.eclipse.jgit.test/bin:/home/me/SW/JGIT/org.eclipse.jgit/bin:/home/me/workspaces/workspace.EGIT-3.4/com.jcraft.jsch:/home/me/eclipse-3.4/plugins/org.junit_3.8.2.v20080602-1318/junit.jar:/home/me/eclipse-3.4/configuration/org.eclipse.osgi/bundles/211/1/.cp/:/home/me/eclipse-3.4/configuration/org.eclipse.osgi/bundles/212/1/.cp/'
user.name = 'me'
java.vm.specification.version = '1.0'
java.home = '/usr/lib/jvm/java-6-openjdk/jre'
sun.arch.data.model = '32'
user.language = 'sv'
java.specification.vendor = 'Sun Microsystems Inc.'
java.vm.info = 'mixed mode'
java.version = '1.6.0_0'
java.ext.dirs = '/usr/lib/jvm/java-6-openjdk/jre/lib/ext:/usr/java/packages/lib/ext'
sun.boot.class.path = '/usr/lib/jvm/java-6-openjdk/jre/lib/resources.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/jsse.jar:/usr/lib/jvm/java-6-
openjdk/jre/lib/jce.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/charsets.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar:/usr/lib/jvm/java-6-openjdk/jre/classes'
java.vendor = 'Sun Microsystems Inc.'
file.separator = '/'
java.vendor.url.bug = 'http://java.sun.com/cgi-bin/bugreport.cgi'
sun.io.unicode.encoding = 'UnicodeLittle'
sun.cpu.endian = 'little'
sun.cpu.isalist = ''
EXPR=d (64)i (69)f (66)f (66)  (20)- (2d)- (2d)g (67)i (69)t (74)  (20)a (61)/ (2f)X (58)  (20)b (62)/ (2f)X (58)
 (a)i (69)n (6e)d (64)e (65)x (78)  (20)0 (30)1 (31)4 (34)e (65)f (66)3 (33)0 (30). (2e). (2e)2 (32)0 (30)9 (39)d (64)b (62)0 (30)d (64)  (20)1 (31)0 (30)0 (30)6 (36)4 (34)4 (34)
 (a)- (2d)- (2d)- (2d)  (20)a (61)/ (2f)X (58)
 (a)+ (2b)+ (2b)+ (2b)  (20)b (62)/ (2f)X (58)
 (a)@ (40)@ (40)  (20)- (2d)1 (31), (2c)7 (37)  (20)+ (2b)1 (31), (2c)7 (37)  (20)@ (40)@ (40)
 (a)  (20)a (61)
 (a)  (20)b (62)
 (a)  (20)c (63)
 (a)- (2d)Å (c5)n (6e)g (67)s (73)t (74)r (72)ö (f6)m (6d)
 (a)+ (2b)Å (c5)n (6e)g (67)s (73)t (74)r (72)ö (f6)m (6d)
 (a)  (20)d (64)
 (a)  (20)e (65)
 (a)  (20)f (66)
 (a)@ (40)@ (40)  (20)- (2d)1 (31)3 (33), (2c)6 (36)  (20)+ (2b)1 (31)3 (33), (2c)6 (36)  (20)@ (40)@ (40)  (20)k (6b)
 (a)  (20)l (6c)
 (a)  (20)m (6d)
 (a)  (20)n (6e)
 (a)- (2d)Å (c5)n (6e)g (67)s (73)t (74)r (72)ö (f6)m (6d)
 (a)+ (2b)Å (c5)n (6e)g (67)s (73)t (74)r (72)ö (f6)m (6d)
 (a)  (20)o (6f)
 (a)  (20)p (70)
 (a)
EXPR=d (64)i (69)f (66)f (66)  (20)- (2d)- (2d)g (67)i (69)t (74)  (20)a (61)/ (2f)X (58)  (20)b (62)/ (2f)X (58)
 (a)i (69)n (6e)d (64)e (65)x (78)  (20)0 (30)1 (31)4 (34)e (65)f (66)3 (33)0 (30). (2e). (2e)2 (32)0 (30)9 (39)d (64)b (62)0 (30)d (64)  (20)1 (31)0 (30)0 (30)6 (36)4 (34)4 (34)
 (a)- (2d)- (2d)- (2d)  (20)a (61)/ (2f)X (58)
 (a)+ (2b)+ (2b)+ (2b)  (20)b (62)/ (2f)X (58)
 (a)@ (40)@ (40)  (20)- (2d)1 (31), (2c)7 (37)  (20)+ (2b)1 (31), (2c)7 (37)  (20)@ (40)@ (40)
 (a)  (20)a (61)
 (a)  (20)b (62)
 (a)  (20)c (63)
 (a)- (2d)Å (c5)n (6e)g (67)s (73)t (74)r (72)ö (f6)m (6d)
 (a)+ (2b)Å (c5)n (6e)g (67)s (73)t (74)r (72)ö (f6)m (6d)
 (a)  (20)d (64)
 (a)  (20)e (65)
 (a)  (20)f (66)
 (a)@ (40)@ (40)  (20)- (2d)1 (31)3 (33), (2c)6 (36)  (20)+ (2b)1 (31)3 (33), (2c)6 (36)  (20)@ (40)@ (40)  (20)k (6b)
 (a)  (20)l (6c)
 (a)  (20)m (6d)
 (a)  (20)n (6e)
 (a)- (2d)Å (c5)n (6e)g (67)s (73)t (74)r (72)ö (f6)m (6d)
 (a)+ (2b)Å (c5)n (6e)g (67)s (73)t (74)r (72)ö (f6)m (6d)
 (a)  (20)o (6f)
 (a)  (20)p (70)
 (a)

There ought to be something different that can help us explain the difference. Just a hunch, your build is
not doing the same thing with resources as mine.

-- robin



Back to the top