File tree Expand file tree Collapse file tree 3 files changed +18
-9
lines changed Expand file tree Collapse file tree 3 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ CLASSES += src/malva/java/lang/StringTest.class
24
24
CLASSES += src/malva/java/lang/RuntimeTest.class
25
25
CLASSES += src/malva/java/lang/SystemTest.class
26
26
CLASSES += src/malva/java/lang/ThrowableTest.class
27
+ CLASSES += src/malva/java/net/InetAddressTest.class
27
28
CLASSES += src/malva/java/net/NetworkInterfaceTest.class
28
29
29
30
SRC := $(patsubst % .class,% .java,$(CLASSES ) )
Original file line number Diff line number Diff line change
1
+ package malva .java .net ;
2
+
3
+ import java .net .InetAddress ;
4
+ import malva .TestCase ;
5
+
6
+ public class InetAddressTest extends TestCase {
7
+ public static void testIsLoopback () throws Exception {
8
+ assertTrue (InetAddress .getByName ("127.0.0.1" ).isLoopbackAddress ());
9
+ assertFalse (InetAddress .getByName ("192.168.0.1" ).isLoopbackAddress ());
10
+ }
11
+
12
+ public static void main (String [] args ) throws Exception {
13
+ testIsLoopback ();
14
+ }
15
+ }
Original file line number Diff line number Diff line change @@ -68,13 +68,8 @@ public static void testGetMTU() throws Exception {
68
68
}
69
69
70
70
public static void testIsLoopback () throws Exception {
71
- for (NetworkInterface iface : getNetworkInterfaces ()) {
72
- if (iface .isLoopback ()) {
73
- for (InetAddress addr : getInetAddresses (iface )) {
74
- assertTrue (addr .isLoopbackAddress ());
75
- }
76
- }
77
- }
71
+ assertTrue (NetworkInterface .getByName ("127.0.0.1" ).isLoopback ());
72
+ assertFalse (NetworkInterface .getByName ("192.168.0.1" ).isLoopback ());
78
73
}
79
74
80
75
public static void testToString () throws Exception {
@@ -116,8 +111,6 @@ public static void main(String[] args) throws Exception {
116
111
testGetByName ();
117
112
testGetByInetAddress ();
118
113
testGetMTU ();
119
- // FIXME: BROKEN
120
- // testIsLoopback();
121
114
testToString ();
122
115
}
123
116
}
You can’t perform that action at this time.
0 commit comments