@@ -22,17 +22,17 @@ TEST_CASE(
22
22
" optionally converting invalid string to integer should return nullopt" ,
23
23
" [core][util][string2int]" )
24
24
{
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 () );
27
27
}
28
28
29
29
TEST_CASE (
30
30
" optionally converting string out of range to integer should return nullopt" ,
31
31
" [core][util][string2int]" )
32
32
{
33
33
REQUIRE (
34
- string2optional_int (" 0xfffffffffffffffffffffffffffffffffffffffffff" , 16 ) ==
35
- nullopt );
34
+ ! string2optional_int (" 0xfffffffffffffffffffffffffffffffffffffffffff" , 16 )
35
+ . has_value () );
36
36
}
37
37
38
38
TEST_CASE (
@@ -47,18 +47,18 @@ TEST_CASE(
47
47
" optionally converting invalid string to unsigned should return nullopt" ,
48
48
" [core][util][string2int]" )
49
49
{
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 () );
52
52
}
53
53
54
54
TEST_CASE (
55
55
" optionally converting string out of range to unsigned should return nullopt" ,
56
56
" [core][util][string2int]" )
57
57
{
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 () );
62
62
}
63
63
64
64
TEST_CASE (
@@ -73,16 +73,16 @@ TEST_CASE(
73
73
" optionally converting invalid string to size_t should return nullopt" ,
74
74
" [core][util][string2int]" )
75
75
{
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 () );
78
78
}
79
79
80
80
TEST_CASE (
81
81
" optionally converting string out of range to size_t should return nullopt" ,
82
82
" [core][util][string2int]" )
83
83
{
84
84
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 () );
88
88
}
0 commit comments