Skip to content
Snippets Groups Projects

more tests

Merged Julian Schakib requested to merge jschakib into develop
3 unresolved threads

plenty of tests and two helper files.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
2 #include "matrix_helper.hh"
3
4
5 TG_FUZZ_TEST(TypedGeometry, Inverse)
6 {
7 // random mat1 inverse test
8 {
9 auto box1 = tg::aabb1(tg::pos1(-1), tg::pos1(1));
10
11 auto m = tg::mat1();
12 auto r = 0.0f;
13 while (r == 0)
14 r = uniform(rng, box1).x * 10.0f;
15 m.col(0) = r;
16
17 CHECK(helper::isIdentity<1, tg::f32>({tg::inverse(m) * m}, tg::f32(1e-2)));
  • 1 #include "test.hh"
    2
    3 TG_FUZZ_TEST(TypedGeometry, Length)
    4 {
    5 auto box1 = tg::aabb1(tg::pos1(-1.0f), tg::pos1(1.0f));
    6 auto box2 = tg::aabb2(tg::pos2(-1.0f), tg::pos2(1.0f));
    7 auto box3 = tg::aabb3(tg::pos3(-1.0f), tg::pos3(1.0f));
    8 auto box4 = tg::aabb4(tg::pos4(-1.0f), tg::pos4(1.0f));
    9
    10 // length and length2 tests
    11
    12 // check consistency of length and length2
    13 // vecs
    14 {
    15 auto v = tg::vec1(uniform(rng, box1));
    16 CHECK(tg::length(v) == doctest::Approx(tg::sqrt(tg::length2(v))).epsilon(1e-5));
  • 1 #pragma once
    2
    3 #include <typed-geometry/tg.hh>
    4
    5 namespace helper
    6 {
    7 // checks if two vectors are identical
    8 template <int D, class ScalarT>
    9 inline bool isIdentical(tg::vec<D, ScalarT> u, tg::vec<D, ScalarT> v, ScalarT eps = 0)
  • Julian Schakib added 3 commits

    added 3 commits

    Compare with previous version

  • Julian Schakib added 1 commit

    added 1 commit

    Compare with previous version

  • Julian Schakib added 2 commits

    added 2 commits

    Compare with previous version

  • Philip Trettner enabled an automatic merge when the pipeline for 00863f52 succeeds

    enabled an automatic merge when the pipeline for 00863f52 succeeds

  • Philip Trettner mentioned in commit e85c943c

    mentioned in commit e85c943c

  • Please register or sign in to reply
    Loading