diff options
| author | J08nY | 2024-03-25 18:36:16 +0100 |
|---|---|---|
| committer | J08nY | 2024-03-25 18:41:11 +0100 |
| commit | acdb72df6ac1bc0abba1a3344d911bd12181d7e9 (patch) | |
| tree | 1db700fd817d6aaf35c14a3c1391c05afde33141 | |
| parent | e8cd86bb309cf90ec5e2aa211a765d3da45590b4 (diff) | |
| download | ECTester-acdb72df6ac1bc0abba1a3344d911bd12181d7e9.tar.gz ECTester-acdb72df6ac1bc0abba1a3344d911bd12181d7e9.tar.zst ECTester-acdb72df6ac1bc0abba1a3344d911bd12181d7e9.zip | |
4 files changed, 29 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73ee885..8be96d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,6 +72,9 @@ jobs: - name: List libraries run: env LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu/" ./gradlew standalone:run --args="list-libs" + - name: Test + run: ./gradlew test + - name: Upload build artifacts uses: actions/upload-artifact@v4 with: diff --git a/standalone/build.gradle.kts b/standalone/build.gradle.kts index e1113e9..68bfd13 100644 --- a/standalone/build.gradle.kts +++ b/standalone/build.gradle.kts @@ -11,6 +11,10 @@ repositories { dependencies { implementation(files("$rootDir/ext/wolfcrypt-jni.jar")) implementation(project(":common")) + + testImplementation(platform("org.junit:junit-bom:5.10.2")) + testImplementation("org.junit.jupiter:junit-jupiter") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") } application { @@ -19,6 +23,10 @@ application { version = "0.3.3" } +tasks.named<Test>("test") { + useJUnitPlatform() +} + tasks.withType<JavaCompile> { if (JavaVersion.current() > JavaVersion.VERSION_1_8) { options.compilerArgs.addAll(arrayOf( diff --git a/standalone/src/main/java/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java b/standalone/src/main/java/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java index 9b912cb..60c60e8 100644 --- a/standalone/src/main/java/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java +++ b/standalone/src/main/java/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java @@ -90,8 +90,12 @@ public class KeyAgreementIdent extends Ident { int split = alias.indexOf("with"); this.algo = alias.substring(0, split); this.kdf = alias.substring(split + 4); + break; } } + if (this.algo == null) { + this.algo = name; + } } } diff --git a/standalone/src/test/java/cz/crcs/ectester/reader/IdentTests.java b/standalone/src/test/java/cz/crcs/ectester/reader/IdentTests.java new file mode 100644 index 0000000..2940f1e --- /dev/null +++ b/standalone/src/test/java/cz/crcs/ectester/reader/IdentTests.java @@ -0,0 +1,14 @@ +package cz.crcs.ectester.reader; + +import cz.crcs.ectester.standalone.consts.KeyAgreementIdent; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +public class IdentTests { + @Test + void kaIdents() { + for (KeyAgreementIdent keyAgreementIdent : KeyAgreementIdent.list()) { + assertNotNull(keyAgreementIdent.getBaseAlgo()); + } + } +} |
