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

Skip to content
Snippets Groups Projects
Commit a0bf8433 authored by str4d's avatar str4d
Browse files

Tests: copy the EdDSA test.data file to where the classloader can find it

parent 9104bd73
No related branches found
No related tags found
No related merge requests found
...@@ -128,6 +128,7 @@ ...@@ -128,6 +128,7 @@
<!-- EdDSA test vectors --> <!-- EdDSA test vectors -->
<copy todir="./build/obj"> <copy todir="./build/obj">
<fileset dir="./test/junit/"> <fileset dir="./test/junit/">
<include name="net/i2p/crypto/eddsa/test.data"/>
<include name="net/i2p/crypto/eddsa/math/baseDblPrecmp"/> <include name="net/i2p/crypto/eddsa/math/baseDblPrecmp"/>
<include name="net/i2p/crypto/eddsa/math/basePrecmp"/> <include name="net/i2p/crypto/eddsa/math/basePrecmp"/>
</fileset> </fileset>
...@@ -154,7 +155,7 @@ ...@@ -154,7 +155,7 @@
<!-- warning - The junit.test target below doesn't actually include i2ptest.jar in the classpath, <!-- warning - The junit.test target below doesn't actually include i2ptest.jar in the classpath,
only the build/obj directory. only the build/obj directory.
--> -->
<jar destfile="./build/i2ptest.jar" basedir="./build/obj" includes="**/*.class **/baseDblPrecmp **/basePrecmp" /> <jar destfile="./build/i2ptest.jar" basedir="./build/obj" includes="**/*.class **/test.data **/baseDblPrecmp **/basePrecmp" />
</target> </target>
<!-- preparation of code coverage tool of choice --> <!-- preparation of code coverage tool of choice -->
<target name="prepareClover" depends="compile" if="with.clover"> <target name="prepareClover" depends="compile" if="with.clover">
......
...@@ -2,6 +2,7 @@ package net.i2p.crypto.eddsa; ...@@ -2,6 +2,7 @@ package net.i2p.crypto.eddsa;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
...@@ -32,8 +33,10 @@ public class Ed25519TestVectors { ...@@ -32,8 +33,10 @@ public class Ed25519TestVectors {
List<TestTuple> testCases = new ArrayList<TestTuple>(); List<TestTuple> testCases = new ArrayList<TestTuple>();
BufferedReader file = null; BufferedReader file = null;
try { try {
file = new BufferedReader(new InputStreamReader( InputStream is = Ed25519TestVectors.class.getResourceAsStream(fileName);
Ed25519TestVectors.class.getResourceAsStream(fileName))); if (is == null)
throw new IOException("Resource not found: " + fileName);
file = new BufferedReader(new InputStreamReader(is));
String line; String line;
while ((line = file.readLine()) != null) { while ((line = file.readLine()) != null) {
testCases.add(new TestTuple(line)); testCases.add(new TestTuple(line));
......
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