@@ -22,17 +22,17 @@ TEST_CASE(
2222 " optionally converting invalid string to integer should return nullopt" ,
2323 " [core][util][string2int]" )
2424{
25- REQUIRE (string2optional_int (" thirteen" ) == nullopt );
26- REQUIRE (string2optional_int (" c0fefe" ) == nullopt );
25+ REQUIRE (! string2optional_int (" thirteen" ). has_value () );
26+ REQUIRE (! string2optional_int (" c0fefe" ). has_value () );
2727}
2828
2929TEST_CASE (
3030 " optionally converting string out of range to integer should return nullopt" ,
3131 " [core][util][string2int]" )
3232{
3333 REQUIRE (
34- string2optional_int (" 0xfffffffffffffffffffffffffffffffffffffffffff" , 16 ) ==
35- nullopt );
34+ ! string2optional_int (" 0xfffffffffffffffffffffffffffffffffffffffffff" , 16 )
35+ . has_value () );
3636}
3737
3838TEST_CASE (
@@ -47,18 +47,18 @@ TEST_CASE(
4747 " optionally converting invalid string to unsigned should return nullopt" ,
4848 " [core][util][string2int]" )
4949{
50- REQUIRE (string2optional_unsigned (" thirteen" ) == nullopt );
51- REQUIRE (string2optional_unsigned (" c0fefe" ) == nullopt );
50+ REQUIRE (! string2optional_unsigned (" thirteen" ). has_value () );
51+ REQUIRE (! string2optional_unsigned (" c0fefe" ). has_value () );
5252}
5353
5454TEST_CASE (
5555 " optionally converting string out of range to unsigned should return nullopt" ,
5656 " [core][util][string2int]" )
5757{
58- REQUIRE (
59- string2optional_unsigned (
60- " 0xfffffffffffffffffffffffffffffffffffffffffff " , 16 ) == nullopt );
61- REQUIRE (string2optional_unsigned (" -5" ) == nullopt );
58+ REQUIRE (! string2optional_unsigned (
59+ " 0xfffffffffffffffffffffffffffffffffffffffffff " , 16 )
60+ . has_value () );
61+ REQUIRE (! string2optional_unsigned (" -5" ). has_value () );
6262}
6363
6464TEST_CASE (
@@ -73,16 +73,16 @@ TEST_CASE(
7373 " optionally converting invalid string to size_t should return nullopt" ,
7474 " [core][util][string2int]" )
7575{
76- REQUIRE (string2optional_size_t (" thirteen" ) == nullopt );
77- REQUIRE (string2optional_size_t (" c0fefe" ) == nullopt );
76+ REQUIRE (! string2optional_size_t (" thirteen" ). has_value () );
77+ REQUIRE (! string2optional_size_t (" c0fefe" ). has_value () );
7878}
7979
8080TEST_CASE (
8181 " optionally converting string out of range to size_t should return nullopt" ,
8282 " [core][util][string2int]" )
8383{
8484 REQUIRE (
85- string2optional_size_t (
86- " 0xfffffffffffffffffffffffffffffffffffffffffff " , 16 ) == nullopt );
87- REQUIRE (string2optional_size_t (" -5" ) == nullopt );
85+ ! string2optional_size_t (" 0xfffffffffffffffffffffffffffffffffffffffffff " , 16 )
86+ . has_value () );
87+ REQUIRE (! string2optional_size_t (" -5" ). has_value () );
8888}
0 commit comments