Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Functions
test_fractions_01.cpp File Reference
#include <thread>
#include <cassert>
#include <cinttypes>
#include <cstring>
#include <jau/test/catch2_ext.hpp>
#include <jau/basic_types.hpp>
Include dependency graph for test_fractions_01.cpp:

Go to the source code of this file.

Functions

static int sizeof_time_t ()
 Resembling the GNU/Linux bits/types.h, documenting whether time_t is 32-bit (arm-32) or 64-bit (arm-64, x86_64, ..). More...
 
static int sizeof_tv_nsec ()
 Resembling the GNU/Linux bits/types.h, documenting whether tv_nsec of struct timespec is 32-bit (arm-32) or 64-bit (arm-64, x86_64, ..). More...
 
 TEST_CASE ("Fraction Arithmetic Test 02", "[integer][fraction]")
 
 TEST_CASE ("Fraction Cast Test 01.1", "[integer][fraction][type][to_num_of]")
 
 TEST_CASE ("Fraction GCD and Modulo Test 00", "[integer][fraction][gcd]")
 
 TEST_CASE ("Fraction String Test 01.2", "[integer][fraction][type][string]")
 
 TEST_CASE ("Fraction Time Arithmetic Add Test 03.1", "[fraction][fraction_timespec][add]")
 
 TEST_CASE ("Fraction Time Arithmetic Sub Test 03.2", "[fraction][fraction_timespec][sub]")
 
 TEST_CASE ("Fraction Time Measurement Test 04.01", "[fraction][fraction_timespec][time]")
 
 TEST_CASE ("Fraction Types Test 00", "[fraction][type]")
 
 TEST_CASE ("struct timespec type validation Test 03.00", "[fraction][struct_timespec][time]")
 
template<typename int_type >
static void test_comp_fract (const fraction< int_type > &a, const fraction< int_type > &b, const fraction< int_type > &exp_max, const fraction< int_type > &exp_min, const fraction< int_type > &exp_sum, const fraction< int_type > &exp_diff, const fraction< int_type > &exp_mul, const fraction< int_type > &exp_div)
 
template<typename Rep , typename Period , typename int_type >
static void test_duration (const fraction< int_type > &a, const std::chrono::duration< Rep, Period > &dur_ref, const Rep exp_count)
 
template<typename int_type >
static void test_gcd_fract (const int_type n, const std::make_unsigned_t< int_type > d, const int_type exp_gcd, const int_type exp_num, const std::make_unsigned_t< int_type > exp_denom)
 
template<typename int_type >
static void test_gcd_fract_pm (const int_type n, const std::make_unsigned_t< int_type > d, const int_type exp_gcd, const int_type exp_num, const std::make_unsigned_t< int_type > exp_denom)
 
static void test_to_num_of (const int64_t exp, const fraction< int64_t > &v, const fraction< int64_t > &new_base, bool exp_overflow=false) noexcept
 

Function Documentation

◆ test_gcd_fract()

template<typename int_type >
static void test_gcd_fract ( const int_type  n,
const std::make_unsigned_t< int_type >  d,
const int_type  exp_gcd,
const int_type  exp_num,
const std::make_unsigned_t< int_type >  exp_denom 
)
static

Definition at line 59 of file test_fractions_01.cpp.

Here is the caller graph for this function:

◆ test_gcd_fract_pm()

template<typename int_type >
static void test_gcd_fract_pm ( const int_type  n,
const std::make_unsigned_t< int_type >  d,
const int_type  exp_gcd,
const int_type  exp_num,
const std::make_unsigned_t< int_type >  exp_denom 
)
static

Definition at line 77 of file test_fractions_01.cpp.

◆ test_comp_fract()

template<typename int_type >
static void test_comp_fract ( const fraction< int_type > &  a,
const fraction< int_type > &  b,
const fraction< int_type > &  exp_max,
const fraction< int_type > &  exp_min,
const fraction< int_type > &  exp_sum,
const fraction< int_type > &  exp_diff,
const fraction< int_type > &  exp_mul,
const fraction< int_type > &  exp_div 
)
static

Definition at line 84 of file test_fractions_01.cpp.

Here is the caller graph for this function:

◆ test_duration()

template<typename Rep , typename Period , typename int_type >
static void test_duration ( const fraction< int_type > &  a,
const std::chrono::duration< Rep, Period > &  dur_ref,
const Rep  exp_count 
)
static

Definition at line 188 of file test_fractions_01.cpp.

Here is the caller graph for this function:

◆ TEST_CASE() [1/9]

TEST_CASE ( "Fraction Types Test 00"  ,
""  [fraction][type] 
)

Definition at line 224 of file test_fractions_01.cpp.

◆ TEST_CASE() [2/9]

TEST_CASE ( "Fraction GCD and Modulo Test 00"  ,
""  [integer][fraction][gcd] 
)

Definition at line 300 of file test_fractions_01.cpp.

◆ test_to_num_of()

static void test_to_num_of ( const int64_t  exp,
const fraction< int64_t > &  v,
const fraction< int64_t > &  new_base,
bool  exp_overflow = false 
)
staticnoexcept

Definition at line 311 of file test_fractions_01.cpp.

Here is the caller graph for this function:

◆ TEST_CASE() [3/9]

TEST_CASE ( "Fraction Cast Test 01.1"  ,
""  [integer][fraction][type][to_num_of] 
)

Definition at line 339 of file test_fractions_01.cpp.

◆ TEST_CASE() [4/9]

TEST_CASE ( "Fraction String Test 01.2"  ,
""  [integer][fraction][type][string] 
)

Definition at line 385 of file test_fractions_01.cpp.

◆ TEST_CASE() [5/9]

TEST_CASE ( "Fraction Arithmetic Test 02"  ,
""  [integer][fraction] 
)

Definition at line 426 of file test_fractions_01.cpp.

◆ sizeof_time_t()

static int sizeof_time_t ( )
static

Resembling the GNU/Linux bits/types.h, documenting whether time_t is 32-bit (arm-32) or 64-bit (arm-64, x86_64, ..).

Definition at line 568 of file test_fractions_01.cpp.

Here is the caller graph for this function:

◆ sizeof_tv_nsec()

static int sizeof_tv_nsec ( )
static

Resembling the GNU/Linux bits/types.h, documenting whether tv_nsec of struct timespec is 32-bit (arm-32) or 64-bit (arm-64, x86_64, ..).

Definition at line 587 of file test_fractions_01.cpp.

Here is the caller graph for this function:

◆ TEST_CASE() [6/9]

TEST_CASE ( "struct timespec type validation Test 03.00"  ,
""  [fraction][struct_timespec][time] 
)

Definition at line 599 of file test_fractions_01.cpp.

◆ TEST_CASE() [7/9]

TEST_CASE ( "Fraction Time Arithmetic Add Test 03.1"  ,
""  [fraction][fraction_timespec][add] 
)

Definition at line 615 of file test_fractions_01.cpp.

◆ TEST_CASE() [8/9]

TEST_CASE ( "Fraction Time Arithmetic Sub Test 03.2"  ,
""  [fraction][fraction_timespec][sub] 
)

Definition at line 741 of file test_fractions_01.cpp.

◆ TEST_CASE() [9/9]

TEST_CASE ( "Fraction Time Measurement Test 04.01"  ,
""  [fraction][fraction_timespec][time] 
)

Definition at line 874 of file test_fractions_01.cpp.