Toolbox snapshot
The Reactive C++ Toolbox
Loading...
Searching...
No Matches
Functions
Utility.ut.cpp File Reference
#include "Utility.hpp"
#include <cmath>
#include <boost/test/unit_test.hpp>
Include dependency graph for Utility.ut.cpp:

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (StobCase)
 
 BOOST_CHECK_EQUAL (stod("1"sv), 1)
 
 BOOST_CHECK_EQUAL (stod("-1"sv), -1)
 
 BOOST_CHECK_EQUAL (stod("1.23E2"sv), 123)
 
 BOOST_CHECK_EQUAL (stod("-1.23E2"sv), -123)
 
 BOOST_CHECK_EQUAL (stod("1.23E1"sv), 12.3)
 
 BOOST_CHECK_EQUAL (stod("-1.23E1"sv), -12.3)
 
 BOOST_CHECK_EQUAL (stod("1.23"sv), 1.23)
 
 BOOST_CHECK_EQUAL (stod("-1.23"sv), -1.23)
 
 BOOST_CHECK (isnan(stod(""sv, numeric_limits< double >::quiet_NaN())))
 
 BOOST_CHECK (isnan(stod("abc"sv, numeric_limits< double >::quiet_NaN())))
 
 BOOST_CHECK_EQUAL (stod("1"sv, numeric_limits< double >::quiet_NaN()), 1)
 
 BOOST_CHECK_EQUAL (ston< double >("1"sv), 1)
 
 BOOST_CHECK_EQUAL (ston< double >("-1"sv), -1)
 
 BOOST_CHECK_EQUAL (ston< double >("1.23E2"sv), 123)
 
 BOOST_CHECK_EQUAL (ston< double >("-1.23E2"sv), -123)
 
 BOOST_CHECK_EQUAL (ston< double >("1.23E1"sv), 12.3)
 
 BOOST_CHECK_EQUAL (ston< double >("-1.23E1"sv), -12.3)
 
 BOOST_CHECK_EQUAL (ston< double >("1.23"sv), 1.23)
 
 BOOST_CHECK_EQUAL (ston< double >("-1.23"sv), -1.23)
 
 BOOST_AUTO_TEST_CASE (StonSubstrCase)
 
 BOOST_AUTO_TEST_CASE (Stoi16Case)
 
 BOOST_AUTO_TEST_CASE (Stoi32Case)
 
 BOOST_AUTO_TEST_CASE (Stoi32NegSignCase)
 
 BOOST_AUTO_TEST_CASE (Stoi64Case)
 
 BOOST_AUTO_TEST_CASE (Stou16Case)
 
 BOOST_AUTO_TEST_CASE (Stou32Case)
 
 BOOST_AUTO_TEST_CASE (Stou64Case)
 
 BOOST_AUTO_TEST_CASE (HexDigitsCase)
 
 BOOST_AUTO_TEST_CASE (DecDigitsCase)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/11]

BOOST_AUTO_TEST_CASE ( StobCase  )

Definition at line 29 of file Utility.ut.cpp.

◆ BOOST_CHECK_EQUAL() [1/17]

BOOST_CHECK_EQUAL ( stod("1"sv ,
 
)

◆ BOOST_CHECK_EQUAL() [2/17]

BOOST_CHECK_EQUAL ( stod("-1"sv ,
1 
)

◆ BOOST_CHECK_EQUAL() [3/17]

BOOST_CHECK_EQUAL ( stod("1.23E2"sv)  ,
123   
)

◆ BOOST_CHECK_EQUAL() [4/17]

BOOST_CHECK_EQUAL ( stod("-1.23E2"sv)  ,
123 
)

◆ BOOST_CHECK_EQUAL() [5/17]

BOOST_CHECK_EQUAL ( stod("1.23E1"sv)  ,
12.  3 
)

◆ BOOST_CHECK_EQUAL() [6/17]

BOOST_CHECK_EQUAL ( stod("-1.23E1"sv)  ,
-12.  3 
)

◆ BOOST_CHECK_EQUAL() [7/17]

BOOST_CHECK_EQUAL ( stod("1.23"sv ,
1.  23 
)

◆ BOOST_CHECK_EQUAL() [8/17]

BOOST_CHECK_EQUAL ( stod("-1.23"sv ,
-1.  23 
)

◆ BOOST_CHECK() [1/2]

BOOST_CHECK ( isnan(stod(""sv, numeric_limits< double >::quiet_NaN()))  )

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ BOOST_CHECK() [2/2]

BOOST_CHECK ( isnan(stod("abc"sv, numeric_limits< double >::quiet_NaN()))  )

◆ BOOST_CHECK_EQUAL() [9/17]

BOOST_CHECK_EQUAL ( stod("1"sv, numeric_limits< double >::quiet_NaN())  ,
 
)

◆ BOOST_CHECK_EQUAL() [10/17]

BOOST_CHECK_EQUAL ( ston< double >  "1"sv,
 
)

◆ BOOST_CHECK_EQUAL() [11/17]

BOOST_CHECK_EQUAL ( ston< double >  "-1"sv,
1 
)

◆ BOOST_CHECK_EQUAL() [12/17]

BOOST_CHECK_EQUAL ( ston< double >  "1.23E2"sv,
123   
)

◆ BOOST_CHECK_EQUAL() [13/17]

BOOST_CHECK_EQUAL ( ston< double >  "-1.23E2"sv,
123 
)

◆ BOOST_CHECK_EQUAL() [14/17]

BOOST_CHECK_EQUAL ( ston< double >  "1.23E1"sv,
12.  3 
)

◆ BOOST_CHECK_EQUAL() [15/17]

BOOST_CHECK_EQUAL ( ston< double >  "-1.23E1"sv,
-12.  3 
)

◆ BOOST_CHECK_EQUAL() [16/17]

BOOST_CHECK_EQUAL ( ston< double >  "1.23"sv,
1.  23 
)

◆ BOOST_CHECK_EQUAL() [17/17]

BOOST_CHECK_EQUAL ( ston< double >  "-1.23"sv,
-1.  23 
)

◆ BOOST_AUTO_TEST_CASE() [2/11]

BOOST_AUTO_TEST_CASE ( StonSubstrCase  )

Definition at line 102 of file Utility.ut.cpp.

◆ BOOST_AUTO_TEST_CASE() [3/11]

BOOST_AUTO_TEST_CASE ( Stoi16Case  )

Definition at line 109 of file Utility.ut.cpp.

◆ BOOST_AUTO_TEST_CASE() [4/11]

BOOST_AUTO_TEST_CASE ( Stoi32Case  )

Definition at line 122 of file Utility.ut.cpp.

◆ BOOST_AUTO_TEST_CASE() [5/11]

BOOST_AUTO_TEST_CASE ( Stoi32NegSignCase  )

Definition at line 135 of file Utility.ut.cpp.

◆ BOOST_AUTO_TEST_CASE() [6/11]

BOOST_AUTO_TEST_CASE ( Stoi64Case  )

Definition at line 145 of file Utility.ut.cpp.

◆ BOOST_AUTO_TEST_CASE() [7/11]

BOOST_AUTO_TEST_CASE ( Stou16Case  )

Definition at line 158 of file Utility.ut.cpp.

◆ BOOST_AUTO_TEST_CASE() [8/11]

BOOST_AUTO_TEST_CASE ( Stou32Case  )

Definition at line 170 of file Utility.ut.cpp.

◆ BOOST_AUTO_TEST_CASE() [9/11]

BOOST_AUTO_TEST_CASE ( Stou64Case  )

Definition at line 182 of file Utility.ut.cpp.

◆ BOOST_AUTO_TEST_CASE() [10/11]

BOOST_AUTO_TEST_CASE ( HexDigitsCase  )

Definition at line 194 of file Utility.ut.cpp.

◆ BOOST_AUTO_TEST_CASE() [11/11]

BOOST_AUTO_TEST_CASE ( DecDigitsCase  )

Definition at line 211 of file Utility.ut.cpp.