Skip to content

Commit 416415b

Browse files
committed
test: add unit tests for new utility functions
Add comprehensive unit tests for refactoring utilities: - TensorHelpersTest: Test toSpan<T> for Tensor and EValue conversions * Float and int32 tensors * Multidimensional tensors * Empty tensors * Type safety and const correctness - ComputerVisionProcessingTest: Test extractDetectionData * Single and multiple detections * Various indices and label formats * Edge cases (negative coords, fractional values) - FrameTransformTest: Test inverseRotateBboxes batch helper * Batch rotation of multiple detections * Empty containers and single detection * Preservation of non-bbox fields Updated CMakeLists.txt to register new test executables.
1 parent d2c0598 commit 416415b

5 files changed

Lines changed: 6482 additions & 0 deletions

File tree

packages/react-native-executorch/common/rnexecutorch/tests/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,13 @@ add_rn_test(FrameTransformTests unit/FrameTransformTest.cpp
171171
LIBS opencv_deps
172172
)
173173

174+
add_rn_test(TensorHelpersTest unit/TensorHelpersTest.cpp)
175+
176+
add_rn_test(ComputerVisionProcessingTest unit/ComputerVisionProcessingTest.cpp
177+
SOURCES
178+
${RNEXECUTORCH_DIR}/utils/computer_vision/Processing.cpp
179+
)
180+
174181
add_rn_test(BaseModelTests integration/BaseModelTest.cpp)
175182

176183
add_rn_test(VisionModelTests integration/VisionModelTest.cpp

0 commit comments

Comments
 (0)