Commit ae3e28d8 authored by Philip Trettner's avatar Philip Trettner
Browse files

added large float normalize test

parent 030b3608
Pipeline #13517 failed with stage
in 6 minutes and 12 seconds
typed-geometry @ fabd052a
Subproject commit 8a44a515e90a69770a4dfc79c75fe5c16794a1d6
Subproject commit fabd052a0bcd32b45b030d4b3f5e81f740dba0e6
......@@ -42,3 +42,31 @@ TG_FUZZ_TEST(TypedGeometry, Normalize)
}
}
}
TG_FUZZ_TEST(TypedGeometry, BigNormalize)
{
// float
{
auto max_r = tg::pow(10.f, uniform(rng, -18.0f, 18.0f));
auto range1 = tg::aabb1(-max_r, max_r);
auto range2 = tg::aabb2(-max_r, max_r);
auto range3 = tg::aabb3(-max_r, max_r);
auto v0 = uniform_vec(rng, range1);
auto v1 = uniform_vec(rng, range1);
auto v2 = uniform_vec(rng, range1);
auto d0 = normalize(v0);
auto d1 = normalize(v1);
auto d2 = normalize(v2);
CHECK(tg::detail::is_dir_valid(d0));
CHECK(tg::detail::is_dir_valid(d1));
CHECK(tg::detail::is_dir_valid(d2));
CHECK(dot(d0, d0) == approx(1.f));
CHECK(dot(d1, d1) == approx(1.f));
CHECK(dot(d2, d2) == approx(1.f));
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment