Update of /cvsroot/freenet/freenet/src/freenet/support/test
In directory sc8-pr-cvs1:/tmp/cvs-serv25857/src/freenet/support/test
Modified Files:
Tag: stable
FieldsTest.java
Log Message:
5029: Merge from unstable after months of work. MASSIVE changes.
Highlights:
* Next Generation Routing, massive related changes
* Major changes to handling of messages and connections (PeerHandler and related
changes)
* Even more non-blocking I/O
* Documentation improvements
* Lots of new diagnostics and config options
* Lots of bug fixes and performance tweaking
* Probably lots of new bugs too!
Index: FieldsTest.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/support/test/FieldsTest.java,v
retrieving revision 1.2
retrieving revision 1.2.6.1
diff -u -w -r1.2 -r1.2.6.1
--- FieldsTest.java 23 Mar 2002 22:29:26 -0000 1.2
+++ FieldsTest.java 28 Oct 2003 20:20:47 -0000 1.2.6.1
@@ -26,8 +26,8 @@
}
public void setUp() {
- if (Core.randSource != null)
- random = Core.randSource;
+ if (Core.getRandSource() != null)
+ random = Core.getRandSource();
else
random = new Yarrow();
}
@@ -51,27 +51,27 @@
for (int i = 0; i < vals.length ; i++) {
assertEquals("Testing encoding of " + vals[i], strings[i],
- Fields.longToString(vals[i]));
+ Fields.longToHex(vals[i]));
assertEquals("Testing decoding of " + strings[i], vals[i],
- Fields.stringToLong(strings[i]));
+ Fields.hexToLong(strings[i]));
}
// now for some random
for (int i = 0 ; i < 1000 ; i++) {
long l = random.nextLong();
assertEquals("Checking encode/decode of " + l,
- l, Fields.stringToLong(Fields.longToString(l)));
+ l, Fields.hexToLong(Fields.longToHex(l)));
}
// check failure
try {
- Fields.stringToLong("xxx");
+ Fields.hexToLong("xxx");
fail("Didn't throw NFE on decoding 'xxx'");
} catch (NumberFormatException e) {
}
try {
- Fields.stringToLong("112233445566778899");
+ Fields.hexToLong("112233445566778899");
fail("Didn't throw NFE on decoding 18 characters");
} catch (NumberFormatException e) {
}
_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs