test(s3): add negative/boundary tests for H3/H4/H5/V5/V6
H3 (GaussBonnet suite, test_phase6.cpp):
- EnforceReturnsCorrectionMagnitude_LargeCorrection: feeds tetrahedron
with all theta_v=0, asserts returned correction is exactly 4pi.
- EnforceReturnsCorrectionMagnitude_NearZeroWhenAlreadyCorrect: angles
already satisfy GB, asserts correction near zero.
- EnforceRawMapOverload_ReturnsCorrection: verifies the raw-map overload
also returns the correction magnitude.
H4 (PeriodMatrix suite, test_phase7.cpp):
- ReduceToFD_ThrowsForRealAxisBoundary: the boundary Im(tau)==0.0 (real
axis) must throw domain_error, covering the <= guard's exact boundary.
H5 (NewtonSolver suite, test_newton_solver.cpp):
- Euclidean_SliverTriangle_CharacterizedBehavior: near-degenerate sliver
triangle (aspect ratio ~10000) — solver must not crash or NaN, and
must not report LinearSolverFailed (system is still consistent).
- Euclidean_ExactDegenerateTriangle_NoCrash: collinear vertices (zero
area) — euclidean_cot_weights returns {0,0,0,false}; asserts no crash
and that the reported status is a meaningful failure mode.
V5 (Serialization suite, test_layout.cpp):
- LoadResultXml_RejectsReformattedRootElement: <ConformalResult> with
geometry= on a separate line throws runtime_error.
- LoadResultXml_RejectsDOFVectorWithTagOpenOnSeparateLine: <DOFVector>
with '>' on a separate line throws runtime_error.
- LoadResultXml_CanonicalFormatStillWorks: regression guard confirming
save_result_xml canonical output still round-trips correctly.
V6 (Serialization suite, test_layout.cpp):
- CheckDofVectorSize_ThrowsOnMismatch: size 3 vs expected 5 throws.
- CheckDofVectorSize_PassesOnMatch: exact match does not throw.
- CheckDofVectorSize_ErrorMessageNamesExpectedAndActual: exception
message contains both the actual and expected sizes.
Total CGAL tests: 313 (up from 298; 15 new tests, 0 failures).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -315,6 +315,22 @@ TEST(PeriodMatrix, ReduceToFD_ThrowsForNonUpperHalfPlane)
|
||||
EXPECT_THROW(reduce_to_fundamental_domain(tau), std::domain_error);
|
||||
}
|
||||
|
||||
// H4 (test-coverage audit, 2026-06-01): the guard is `Im(τ) <= 0.0`, so
|
||||
// the exact boundary Im(τ) == 0.0 (the real axis) must also throw.
|
||||
// The previous test only checked Im(τ) < 0; this covers the boundary.
|
||||
TEST(PeriodMatrix, ReduceToFD_ThrowsForRealAxisBoundary)
|
||||
{
|
||||
// Im(τ) == 0.0 exactly — on the real axis, not in the upper half-plane.
|
||||
C tau_real_axis(1.0, 0.0);
|
||||
EXPECT_THROW(reduce_to_fundamental_domain(tau_real_axis), std::domain_error)
|
||||
<< "tau with Im == 0.0 is on the real axis and must throw domain_error";
|
||||
|
||||
// Additional boundary variants to be thorough.
|
||||
EXPECT_THROW(reduce_to_fundamental_domain(C(0.0, 0.0)), std::domain_error);
|
||||
EXPECT_THROW(reduce_to_fundamental_domain(C(-0.5, 0.0)), std::domain_error);
|
||||
EXPECT_THROW(reduce_to_fundamental_domain(C(0.5, 0.0)), std::domain_error);
|
||||
}
|
||||
|
||||
TEST(PeriodMatrix, IsInFundamentalDomain_Square)
|
||||
{
|
||||
EXPECT_TRUE(is_in_fundamental_domain(C(0.0, 1.0))); // i
|
||||
|
||||
Reference in New Issue
Block a user