Gitlab service upgraded. Please report any problems to dl_gitadmin@cs.lth.se

Commit 014ca468 authored by Noric Couderc's avatar Noric Couderc

Refactoring: Moved kotling code to its own package

Moved Kotlin code from src/main/java to src/main/kotlin
parent 58469b43
......@@ -52,7 +52,7 @@ fun median(l : List<Double>) : Double {
}
fun medianLong(l : List<Long>) : Double {
return median(l.map{ it.toDouble() })
return median(l.map { it.toDouble() })
}
fun average(l : List<Double>) : Double {
......
......@@ -15,8 +15,6 @@ import java.util.function.IntPredicate;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import static se.lth.cs.UtilsKt.*;
public class ApplicationTest {
@Test
......@@ -188,7 +186,7 @@ public class ApplicationTest {
public void TestPapiEventSet() throws PapiException {
Papi.init();
int[] constants = se.lth.cs.PapiRunnerKt.getCounters();
int[] constants = PapiRunnerKt.getCounters();
IntPredicate throwsExp =
(integer -> {
......@@ -258,14 +256,14 @@ public class ApplicationTest {
values.add(i.doubleValue());
}
Assert.assertEquals(4.5, median(values), 0.001);
Assert.assertEquals(4.5, UtilsKt.median(values), 0.001);
List<Double> values1 = new ArrayList<>();
values1.add(1.0);
values1.add(4.0);
values1.add(5.0);
values1.add(3.0);
Assert.assertEquals(3.5, median(values1), 0.0001);
Assert.assertEquals(3.5, UtilsKt.median(values1), 0.0001);
}
@Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment