Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xs-test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patrick Chen
xs-test
Commits
54100b18
Commit
54100b18
authored
Aug 29, 2018
by
Patrick Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use 'param' as attribute name in script
parent
5001e7da
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
greeting.json
example/greeting.json
+1
-1
Expectation.h
include/test/Expectation.h
+1
-1
Expectation.cc
src/test/Expectation.cc
+3
-3
Tester.cc
src/test/Tester.cc
+1
-1
No files found.
example/greeting.json
View file @
54100b18
...
...
@@ -11,7 +11,7 @@
"script"
:
[
{
"command"
:
"GetMessage"
,
"param
s
"
:
{},
"param"
:
{},
"expect"
:
{
"response"
:
"Hello, Master!"
,
"runs"
:
[
"GetName"
],
...
...
include/test/Expectation.h
View file @
54100b18
...
...
@@ -25,7 +25,7 @@ namespace xs { namespace test
public
:
std
::
string
name_
;
nlohmann
::
json
params
_
;
nlohmann
::
json
request
_
;
nlohmann
::
json
response_
;
std
::
unordered_set
<
std
::
string
>
runs_
;
std
::
unordered_set
<
std
::
string
>
posts_
;
...
...
src/test/Expectation.cc
View file @
54100b18
...
...
@@ -9,7 +9,7 @@ namespace xs { namespace test
Expectation
::
Expectation
(
const
nlohmann
::
json
&
object
)
:
name_
(
object
[
"command"
].
get
<
std
::
string
>
())
{
params_
=
object
[
"params
"
];
request_
=
object
[
"param
"
];
const
auto
&
expect
=
object
[
"expect"
];
response_
=
expect
[
"response"
];
...
...
@@ -43,11 +43,11 @@ namespace xs { namespace test
return
false
;
}
if
(
!
object
.
count
(
"param
s
"
))
{
if
(
!
object
.
count
(
"param"
))
{
return
false
;
}
if
(
!
(
object
[
"param
s"
].
is_string
()
||
object
[
"params
"
].
is_object
()))
{
if
(
!
(
object
[
"param
"
].
is_string
()
||
object
[
"param
"
].
is_object
()))
{
return
false
;
}
...
...
src/test/Tester.cc
View file @
54100b18
...
...
@@ -134,7 +134,7 @@ void Tester::run() noexcept
for
(
const
auto
&
expectation
:
config_
.
getExpectations
())
{
resetCounters
();
const
auto
response
=
server_
.
runCmd
(
expectation
.
name_
,
expectation
.
params
_
.
dump
());
const
auto
response
=
server_
.
runCmd
(
expectation
.
name_
,
expectation
.
request
_
.
dump
());
// wait 100ms for upcoming events
using
namespace
std
::
chrono_literals
;
...
...
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