jaulib v1.3.6
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
test_fractions_01.cpp File Reference
#include <thread>
#include <cassert>
#include <cinttypes>
#include <cstring>
#include <jau/cpp_lang_util.hpp>
#include <jau/debug.hpp>
#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, ..).
 
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, ..).
 
 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 Conversion Test 05.01", "[fraction_timespec][time]")
 
 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 61 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 79 of file test_fractions_01.cpp.

Here is the caller graph for this function:

◆ 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 86 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 190 of file test_fractions_01.cpp.

Here is the caller graph for this function:

◆ TEST_CASE() [1/10]

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

Definition at line 226 of file test_fractions_01.cpp.

◆ TEST_CASE() [2/10]

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

Definition at line 302 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 313 of file test_fractions_01.cpp.

Here is the caller graph for this function:

◆ TEST_CASE() [3/10]

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

Definition at line 341 of file test_fractions_01.cpp.

◆ TEST_CASE() [4/10]

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

Definition at line 387 of file test_fractions_01.cpp.

◆ TEST_CASE() [5/10]

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

Definition at line 428 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 570 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 589 of file test_fractions_01.cpp.

Here is the caller graph for this function:

◆ TEST_CASE() [6/10]

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

Definition at line 601 of file test_fractions_01.cpp.

◆ TEST_CASE() [7/10]

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

Definition at line 617 of file test_fractions_01.cpp.

◆ TEST_CASE() [8/10]

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

Definition at line 743 of file test_fractions_01.cpp.

◆ TEST_CASE() [9/10]

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

Definition at line 876 of file test_fractions_01.cpp.

◆ TEST_CASE() [10/10]

TEST_CASE ( "Fraction Time Conversion Test 05.01" ,
"" [fraction_timespec][time] )

Definition at line 931 of file test_fractions_01.cpp.