Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
f4716a0d
Unverified
Commit
f4716a0d
authored
Jul 30, 2021
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🚨
fix useless-cast warnings
parent
9a459e1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
test/src/unit-class_parser.cpp
test/src/unit-class_parser.cpp
+14
-14
No files found.
test/src/unit-class_parser.cpp
View file @
f4716a0d
...
@@ -1381,7 +1381,7 @@ TEST_CASE("parser class")
...
@@ -1381,7 +1381,7 @@ TEST_CASE("parser class")
case
(
'r'
):
case
(
'r'
):
case
(
't'
):
case
(
't'
):
{
{
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
td
::
string
(
s
)
)).
accept
());
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
)).
accept
());
break
;
break
;
}
}
...
@@ -1394,7 +1394,7 @@ TEST_CASE("parser class")
...
@@ -1394,7 +1394,7 @@ TEST_CASE("parser class")
// any other combination of backslash and character is invalid
// any other combination of backslash and character is invalid
default:
default:
{
{
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
td
::
string
(
s
)
)).
accept
()
==
false
);
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
)).
accept
()
==
false
);
break
;
break
;
}
}
}
}
...
@@ -1445,35 +1445,35 @@ TEST_CASE("parser class")
...
@@ -1445,35 +1445,35 @@ TEST_CASE("parser class")
std
::
string
s
=
"
\"\\
u"
;
std
::
string
s
=
"
\"\\
u"
;
// create a string with the iterated character at each position
// create a string with the iterated character at each position
auto
s1
=
s
+
"000"
+
std
::
string
(
1
,
static_cast
<
char
>
(
c
))
+
"
\"
"
;
const
auto
s1
=
s
+
"000"
+
std
::
string
(
1
,
static_cast
<
char
>
(
c
))
+
"
\"
"
;
auto
s2
=
s
+
"00"
+
std
::
string
(
1
,
static_cast
<
char
>
(
c
))
+
"0
\"
"
;
const
auto
s2
=
s
+
"00"
+
std
::
string
(
1
,
static_cast
<
char
>
(
c
))
+
"0
\"
"
;
auto
s3
=
s
+
"0"
+
std
::
string
(
1
,
static_cast
<
char
>
(
c
))
+
"00
\"
"
;
const
auto
s3
=
s
+
"0"
+
std
::
string
(
1
,
static_cast
<
char
>
(
c
))
+
"00
\"
"
;
auto
s4
=
s
+
std
::
string
(
1
,
static_cast
<
char
>
(
c
))
+
"000
\"
"
;
const
auto
s4
=
s
+
std
::
string
(
1
,
static_cast
<
char
>
(
c
))
+
"000
\"
"
;
if
(
valid
(
c
))
if
(
valid
(
c
))
{
{
CAPTURE
(
s1
)
CAPTURE
(
s1
)
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
td
::
string
(
s1
)
)).
accept
());
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
1
)).
accept
());
CAPTURE
(
s2
)
CAPTURE
(
s2
)
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
td
::
string
(
s2
)
)).
accept
());
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
2
)).
accept
());
CAPTURE
(
s3
)
CAPTURE
(
s3
)
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
td
::
string
(
s3
)
)).
accept
());
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
3
)).
accept
());
CAPTURE
(
s4
)
CAPTURE
(
s4
)
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
td
::
string
(
s4
)
)).
accept
());
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
4
)).
accept
());
}
}
else
else
{
{
CAPTURE
(
s1
)
CAPTURE
(
s1
)
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
td
::
string
(
s1
)
)).
accept
()
==
false
);
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
1
)).
accept
()
==
false
);
CAPTURE
(
s2
)
CAPTURE
(
s2
)
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
td
::
string
(
s2
)
)).
accept
()
==
false
);
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
2
)).
accept
()
==
false
);
CAPTURE
(
s3
)
CAPTURE
(
s3
)
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
td
::
string
(
s3
)
)).
accept
()
==
false
);
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
3
)).
accept
()
==
false
);
CAPTURE
(
s4
)
CAPTURE
(
s4
)
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
td
::
string
(
s4
)
)).
accept
()
==
false
);
CHECK
(
json
::
parser
(
nlohmann
::
detail
::
input_adapter
(
s
4
)).
accept
()
==
false
);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment