Commit a573d7e7 authored by Noric Couderc's avatar Noric Couderc

Added test for checking IDs identify traces

A trace with a different object ID and location should have a different
ID.
parent cbc7a712
......@@ -162,6 +162,31 @@ class TraceLoaderTest {
}
}
@Test
fun multipleObjectsAndIds() {
val text = ",id,location,target_type,method,step\n" +
// Same location, different id
"1,1,loc1,java.util.ArrayList,boolean add(E),1\n" +
"1,1,loc1,java.util.ArrayList,boolean add(E),2\n" +
"1,2,loc1,java.util.ArrayList,boolean add(E),1\n" +
"1,2,loc1,java.util.ArrayList,boolean add(E),2\n"
val reader = StringReader(text)
val apps = TraceLoader().readCsv(reader, false)
.map { it.benchmarkIdentifier }
.collect(Collectors.toList())
// We want each trace to be identified with "location:object_id"
Assert.assertEquals(
"Trace:loc1:1:0:2:List:0:ArrayList",
apps.get(0)
)
Assert.assertEquals(
"Trace:loc1:2:0:2:List:0:ArrayList",
apps.get(1)
)
}
@Test
fun testSerializeDeserialize() {
val text = ",id,location,target_type,method,step\n" +
......
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