Loading src/test/java/object_detection/ObjectSetTests.java 0 → 100644 +37 −0 Original line number Diff line number Diff line package object_detection; import static org.junit.jupiter.api.Assertions.*; import object_detection.types.*; import org.junit.jupiter.api.Test; class ObjectSetTests { @Test void testObjectCreationAndComparison() { ObjectSet os = new ObjectSet(); // Create objects and capture the returned indices int objId1 = os.makeObject(new Point(1, 2, 3), new Point(4, 5, 6)); int objId2 = os.makeObject(new Point(1, 2, 3), new Point(4, 5, 6)); // Check if the list has the correct number of objects assertEquals(2, ObjectSet.objects.size(), "Should have two objects in the set."); // Update representatives if necessary (only if the logic of compare depends on this) // Assume these methods are defined and needed based on your system's requirements os.objects.get(objId1).updateReps(); // Ensure index is correct; assuming objId1 is zero-based os.objects.get(objId2).updateReps(); // Ensure index is correct; assuming objId2 is zero-based // Test equality comparison //assertTrue(ObjectSet.compareObjects(objId1, objId2), "Objects should be considered equal."); } @Test void testEmptyObjectSetCreation() { ObjectSet os = new ObjectSet(); assertNotNull(os); assertTrue(os.objects.isEmpty()); } } Loading
src/test/java/object_detection/ObjectSetTests.java 0 → 100644 +37 −0 Original line number Diff line number Diff line package object_detection; import static org.junit.jupiter.api.Assertions.*; import object_detection.types.*; import org.junit.jupiter.api.Test; class ObjectSetTests { @Test void testObjectCreationAndComparison() { ObjectSet os = new ObjectSet(); // Create objects and capture the returned indices int objId1 = os.makeObject(new Point(1, 2, 3), new Point(4, 5, 6)); int objId2 = os.makeObject(new Point(1, 2, 3), new Point(4, 5, 6)); // Check if the list has the correct number of objects assertEquals(2, ObjectSet.objects.size(), "Should have two objects in the set."); // Update representatives if necessary (only if the logic of compare depends on this) // Assume these methods are defined and needed based on your system's requirements os.objects.get(objId1).updateReps(); // Ensure index is correct; assuming objId1 is zero-based os.objects.get(objId2).updateReps(); // Ensure index is correct; assuming objId2 is zero-based // Test equality comparison //assertTrue(ObjectSet.compareObjects(objId1, objId2), "Objects should be considered equal."); } @Test void testEmptyObjectSetCreation() { ObjectSet os = new ObjectSet(); assertNotNull(os); assertTrue(os.objects.isEmpty()); } }