Add C++ unit tests for tensor_momentum library#1119
Open
cstollmeta wants to merge 1 commit intomainfrom
Open
Conversation
Summary: Adds 42 GoogleTest cases in `cpp_test/tensor_momentum_test.cpp` covering core tensor operations from the tensor_momentum library. The tests cover four of the ten untested source files that have standalone C++ APIs testable without complex Character object setup: - **tensor_quaternion.h** (15 tests): quaternion identity, check validation, split, normalize, conjugate, inverse, multiply (identity and batch), rotate vector, Euler-to-quaternion round-trip, quaternion-to-rotation-matrix round-trip, rotation-matrix-to-quaternion round-trip, blend quaternions, weight normalization - **tensor_transforms.h** (14 tests): identity skeleton state, split skeleton state, quaternion/translation/scale to skeleton state, skeleton state to transforms (identity and translation), multiply skeleton states, transform points (identity, translation, scale, invalid input), inverse skeleton states (with and without rotation), blend skeleton states - **tensor_kd_tree.h** (4 tests): find closest points (exact match, nearest neighbor, max distance filtering), find closest points on mesh (triangle projection) - **tensor_skinning.h** (3 tests): compute vertex normals (simple triangle, invalid input validation, normalization check) Tests focus on edge cases, numerical precision, and input validation — areas where Python integration tests typically lack coverage. The remaining 6 source files (tensor_blend_shape, tensor_parameter_transform, tensor_skeleton_state, tensor_mppca, tensor_joint_parameters_to_positions, tensor_momentum_utility) require Character/ParameterTransform objects from the momentum library and are better suited for a follow-up with appropriate test fixtures. Reviewed By: yutingye Differential Revision: D95466235
Contributor
|
@cstollmeta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95466235. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Adds 42 GoogleTest cases in
cpp_test/tensor_momentum_test.cppcovering core tensor operations from the tensor_momentum library. The tests cover four of the ten untested source files that have standalone C++ APIs testable without complex Character object setup:Tests focus on edge cases, numerical precision, and input validation — areas where Python integration tests typically lack coverage. The remaining 6 source files (tensor_blend_shape, tensor_parameter_transform, tensor_skeleton_state, tensor_mppca, tensor_joint_parameters_to_positions, tensor_momentum_utility) require Character/ParameterTransform objects from the momentum library and are better suited for a follow-up with appropriate test fixtures.
Reviewed By: yutingye
Differential Revision: D95466235