Skip to content

Commit ea2fb81

Browse files
committed
removes Test_EPS from Test__; adds Test_MyInterface to Test__
removing Font.getPSName(), as this is platform specific, and Windows has changed. Windows now assigns Dialog to TimesRoman AND Helvetica??
1 parent 5d3a5c3 commit ea2fb81

File tree

8 files changed

+11
-7
lines changed

8 files changed

+11
-7
lines changed
61 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20220117224934
1+
20220118073747
61 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20220117224934
1+
20220118073747

sources/net.sf.j2s.java.core/src/java/awt/Font.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,8 @@ public String getPSName() {
12711271
// Dialog Dialog.plain Dialog.bold Dialog.italic
12721272
// DialogInput DialogInput.plain DialogInput.bold DialogInput.italic
12731273

1274+
// seems to have changed in Java 8+
1275+
// totally wrong to have Helvetica and TimesRoman become Dialog!
12741276
switch (name) {
12751277
case "TimesRoman":
12761278
name = SERIF;

sources/net.sf.j2s.java.core/src/test/Test_EPS.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static void main(String[] args) {
2121

2222
String s = new Font(fonts[i], Font.PLAIN, 12).getPSName();
2323
String s1 = fonts[i + 1];
24-
System.out.println(i + " " + fonts[i] + " " + s + " " + s1);
24+
System.out.println(i + " " + fonts[i] + " " + s + " == " + s1);
2525
assert(s.equals(s1));
2626
}
2727
System.out.println("Test_EPS OK");

sources/net.sf.j2s.java.core/src/test/Test_MyInterface.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
class Test_MyInterface extends Test_ {
44
public static void main(String[] args) {
55
MyInterfaceImpl impl = new MyInterfaceImpl();
6-
System.out.println(String.valueOf(impl.getValue()));
7-
System.out.println(String.valueOf(impl.getValueImpl()));
8-
System.out.println(String.valueOf(impl.getValue()));
6+
assert(impl.getValue() == 0);
7+
assert(impl.getValueImpl() == 102);
8+
assert(impl.getValue() == 0);
9+
System.out.println("Test_MyInterface OK");
910
}
1011
}

sources/net.sf.j2s.java.core/src/test/Test__.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private static void _test1(String[] args) {
5252
Test_Double.main(args);
5353
Test_Enum.main(args);
5454
Test_Enum2.main(args);
55-
Test_EPS.main(args);
55+
// Test_EPS.main(args); Java bug -- returns Dialog for Helevetica and TimesRoman!???
5656
Test_Extends_6.main(args);
5757
// Test_Extends_7.main(args);
5858
// Test_Extends_JButton.main(args);
@@ -85,6 +85,7 @@ private static void _test1(String[] args) {
8585
//failing on unicode char in "somewhatComplex" Test_JAXB_ORDERED.main(args);
8686
// Test_Map.main(args);
8787
Test_Math.main(args);
88+
Test_MyInterface.main(args);
8889
Test_Native.main(args);
8990
Test_NoAssert.main(args);
9091
Test_NoHeadless_1.main(args);

0 commit comments

Comments
 (0)