Skip to content

Commit

Permalink
adapts test to rgb (from rgba)
Browse files Browse the repository at this point in the history
  • Loading branch information
net-cscience-raphael committed Sep 11, 2024
1 parent 82ca0f9 commit 95e3077
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,20 @@ class PipelineTest {
/* The first 24 frames should be R, followed by G and B. */
for (i in allDescriptors.indices) {
if (i < 24) {
Assertions.assertArrayEquals(floatArrayOf(1.0f, 0.0f, 0.0f, 1.0f), allDescriptors[i].vector.value, 0.05f)
Assertions.assertArrayEquals(floatArrayOf(1.0f, 0.0f, 0.0f), allDescriptors[i].vector.value, 0.05f)
} else if (i < 48) {
Assertions.assertArrayEquals(floatArrayOf(0.0f, 1.0f, 0.0f, 1.0f), allDescriptors[i].vector.value, 0.05f)
Assertions.assertArrayEquals(floatArrayOf(0.0f, 1.0f, 0.0f), allDescriptors[i].vector.value, 0.05f)
} else {
Assertions.assertArrayEquals(floatArrayOf(0.0f, 0.0f, 1.0f, 1.0f), allDescriptors[i].vector.value, 0.05f)
Assertions.assertArrayEquals(floatArrayOf(0.0f, 0.0f, 1.0f), allDescriptors[i].vector.value, 0.05f)
}
}

/* The number of aggregated descriptors should be equal to the number of content elements. */
Assertions.assertEquals(3, aggDescriptors.size)

/* The descriptors should find a full R value followed by G and B. */
Assertions.assertArrayEquals(floatArrayOf(1.0f, 0.0f, 0.0f, 1.0f), aggDescriptors[0].vector.value, 0.05f)
Assertions.assertArrayEquals(floatArrayOf(0.0f, 1.0f, 0.0f, 1.0f), aggDescriptors[1].vector.value, 0.05f)
Assertions.assertArrayEquals(floatArrayOf(0.0f, 0.0f, 1.0f, 1.0f), aggDescriptors[2].vector.value, 0.05f)
Assertions.assertArrayEquals(floatArrayOf(1.0f, 0.0f, 0.0f), aggDescriptors[0].vector.value, 0.05f)
Assertions.assertArrayEquals(floatArrayOf(0.0f, 1.0f, 0.0f), aggDescriptors[1].vector.value, 0.05f)
Assertions.assertArrayEquals(floatArrayOf(0.0f, 0.0f, 1.0f), aggDescriptors[2].vector.value, 0.05f)
}
}

0 comments on commit 95e3077

Please sign in to comment.