I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 6c202e8f authored by zzz's avatar zzz
Browse files

fix router identity test broken by previous checkin

parent 24e67505
No related branches found
No related tags found
No related merge requests found
...@@ -151,11 +151,23 @@ public class KeysAndCert extends DataStructureImpl { ...@@ -151,11 +151,23 @@ public class KeysAndCert extends DataStructureImpl {
return buf.toString(); return buf.toString();
} }
/**
* Throws IllegalStateException if keys and cert are not initialized,
* as of 0.9.12. Prior to that, returned null.
*
* @throws IllegalStateException
*/
@Override @Override
public Hash calculateHash() { public Hash calculateHash() {
return getHash(); return getHash();
} }
/**
* Throws IllegalStateException if keys and cert are not initialized,
* as of 0.9.12. Prior to that, returned null.
*
* @throws IllegalStateException
*/
public Hash getHash() { public Hash getHash() {
if (__calculatedHash != null) if (__calculatedHash != null)
return __calculatedHash; return __calculatedHash;
......
...@@ -101,9 +101,15 @@ public class RouterIdentityTest extends StructureTest { ...@@ -101,9 +101,15 @@ public class RouterIdentityTest extends StructureTest {
ident.calculateHash(); ident.calculateHash();
} }
public void testBadHash() throws Exception{ public void testBadHash() throws Exception {
RouterIdentity ident = new RouterIdentity(); RouterIdentity ident = new RouterIdentity();
ident.getHash(); boolean error = false;
try {
ident.getHash();
} catch (IllegalStateException ise) {
error = true;
}
assertTrue(error);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment