KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_kimath.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <trigo.h>
#include <hash_128.h>
#include <geometry/shape_arc.h>
#include <iomanip>
#include <mmh3_hash.h>

Go to the source code of this file.

Classes

struct  TEST_CALC_ARC_CENTER_CASE
 

Macros

#define FORCE_INLINE   inline __attribute__( ( always_inline ) )
 
#define ROTL64(x, y)   rotl64( x, y )
 
#define BIG_CONSTANT(x)   ( x##LLU )
 

Functions

static bool Ref0CircleCenterFrom3Points (const VECTOR2D &p1, const VECTOR2D &p2, const VECTOR2D &p3, VECTOR2D *aCenter)
 Test suite for KiCad math code.
 
static const VECTOR2D Ref1CalcArcCenter (const VECTOR2D &aStart, const VECTOR2D &aMid, const VECTOR2D &aEnd)
 
 BOOST_AUTO_TEST_CASE (TestCalcArcCenter3Pts)
 Declare the test suite.
 
 BOOST_AUTO_TEST_CASE (TestInterceptsPositiveX)
 
 BOOST_AUTO_TEST_CASE (TestInterceptsNegativeX)
 
 BOOST_AUTO_TEST_CASE (TestHash128)
 
void MurmurHash3_x64_128 (const void *key, const int len, const uint32_t seed, void *out)
 
 BOOST_AUTO_TEST_CASE (TestMMH3Hash)
 
uint64_t rotl64 (uint64_t x, int8_t r)
 
FORCE_INLINE uint64_t getblock64 (const uint64_t *p, int i)
 
FORCE_INLINE uint64_t fmix64 (uint64_t k)
 

Macro Definition Documentation

◆ BIG_CONSTANT

#define BIG_CONSTANT (   x)    ( x##LLU )

Definition at line 414 of file test_kimath.cpp.

◆ FORCE_INLINE

#define FORCE_INLINE   inline __attribute__( ( always_inline ) )

Definition at line 408 of file test_kimath.cpp.

◆ ROTL64

#define ROTL64 (   x,
 
)    rotl64( x, y )

Definition at line 413 of file test_kimath.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/5]

BOOST_AUTO_TEST_CASE ( TestCalcArcCenter3Pts  )

◆ BOOST_AUTO_TEST_CASE() [2/5]

BOOST_AUTO_TEST_CASE ( TestHash128  )

Definition at line 323 of file test_kimath.cpp.

References HASH_128::ToString(), HASH_128::Value64, and HASH_128::Value8.

◆ BOOST_AUTO_TEST_CASE() [3/5]

BOOST_AUTO_TEST_CASE ( TestInterceptsNegativeX  )

Definition at line 311 of file test_kimath.cpp.

References InterceptsNegativeX().

◆ BOOST_AUTO_TEST_CASE() [4/5]

BOOST_AUTO_TEST_CASE ( TestInterceptsPositiveX  )

Definition at line 300 of file test_kimath.cpp.

References InterceptsPositiveX().

◆ BOOST_AUTO_TEST_CASE() [5/5]

BOOST_AUTO_TEST_CASE ( TestMMH3Hash  )

◆ fmix64()

FORCE_INLINE uint64_t fmix64 ( uint64_t  k)

Definition at line 423 of file test_kimath.cpp.

References BIG_CONSTANT.

Referenced by MurmurHash3_x64_128().

◆ getblock64()

FORCE_INLINE uint64_t getblock64 ( const uint64_t *  p,
int  i 
)

Definition at line 418 of file test_kimath.cpp.

Referenced by MurmurHash3_x64_128().

◆ MurmurHash3_x64_128()

void MurmurHash3_x64_128 ( const void *  key,
const int  len,
const uint32_t  seed,
void *  out 
)

Definition at line 434 of file test_kimath.cpp.

References BIG_CONSTANT, fmix64(), getblock64(), and ROTL64.

Referenced by BOOST_AUTO_TEST_CASE().

◆ Ref0CircleCenterFrom3Points()

static bool Ref0CircleCenterFrom3Points ( const VECTOR2D p1,
const VECTOR2D p2,
const VECTOR2D p3,
VECTOR2D aCenter 
)
static

Test suite for KiCad math code.

Definition at line 61 of file test_kimath.cpp.

References VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by BOOST_AUTO_TEST_CASE().

◆ Ref1CalcArcCenter()

static const VECTOR2D Ref1CalcArcCenter ( const VECTOR2D aStart,
const VECTOR2D aMid,
const VECTOR2D aEnd 
)
static

Definition at line 85 of file test_kimath.cpp.

References std::abs(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by BOOST_AUTO_TEST_CASE().

◆ rotl64()

uint64_t rotl64 ( uint64_t  x,
int8_t  r 
)
inline

Definition at line 409 of file test_kimath.cpp.