From 47b461657e193bdd26cefa78b45186d7707e356a Mon Sep 17 00:00:00 2001 From: Quentin Rendu Date: Sun, 1 Oct 2023 11:22:24 +0200 Subject: [PATCH] Update the test of weights against itself --- api-webapp/src/test/kotlin/BasicTests.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api-webapp/src/test/kotlin/BasicTests.kt b/api-webapp/src/test/kotlin/BasicTests.kt index 3e23463..8b99fcb 100644 --- a/api-webapp/src/test/kotlin/BasicTests.kt +++ b/api-webapp/src/test/kotlin/BasicTests.kt @@ -211,6 +211,7 @@ class BasicTests: TestBase() { // Maps to store name pairs and costs val map1 = HashMap, List>() val map2 = HashMap, List>() + var count: Int = 1 for (file in listOf(file1, file2)) { @@ -237,17 +238,16 @@ class BasicTests: TestBase() { } // Add to map - if (file == file1) { + if (count == 1) { map1[Pair(name1, name2)] = costs } else { map2[Pair(name1, name2)] = costs } - } + count += 1 } - var diff_found = false for ((key, value) in map1) { // Check if key exists in both @@ -291,7 +291,7 @@ class BasicTests: TestBase() { logger.info("games for round 1: {}", games_np.toString()) logger.info("Compare weights with itself") - assertTrue(compare_weights("weights.txt", "weights_clone.txt"), "Weights not equal to itselft") + assertTrue(compare_weights("weights.txt", "weights.txt"), "Weights not equal to itselft") logger.info("Compare weights with opengotha") assertTrue(compare_weights("weights.txt", "opengotha/simpleswiss_weightsonly_R1.txt"), "Not matching opengotha weights")