Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
paho.mqtt.c
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
eclipse
paho.mqtt.c
Commits
8b3b2434
Commit
8b3b2434
authored
Jul 19, 2013
by
Ian Craggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
timing and add both tests
parent
1bfa3943
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
build.xml
build.xml
+1
-1
test4.c
test/test4.c
+16
-12
No files found.
build.xml
View file @
8b3b2434
...
...
@@ -145,7 +145,7 @@
</target>
<target
name=
"test"
>
<foreach
target=
"runAtest"
param=
"aTest"
list=
"test4"
/>
<foreach
target=
"runAtest"
param=
"aTest"
list=
"test
1,test
4"
/>
</target>
<target
name=
"runAtest"
>
...
...
test/test4.c
View file @
8b3b2434
...
...
@@ -339,7 +339,7 @@ int test1(struct Options options)
char
*
test_topic
=
"C client test1"
;
MyLog
(
LOGA_INFO
,
"Starting test 1 - asynchronous connect"
);
fprintf
(
xml
,
"<testcase classname=
\"
test
1
\"
name=
\"
asynchronous connect
\"
"
);
fprintf
(
xml
,
"<testcase classname=
\"
test
4
\"
name=
\"
asynchronous connect
\"
"
);
global_start_time
=
start_clock
();
rc
=
MQTTAsync_create
(
&
c
,
options
.
connection
,
"async_test"
,
...
...
@@ -438,7 +438,7 @@ int test2(struct Options options)
test_finished
=
0
;
MyLog
(
LOGA_INFO
,
"Starting test 2 - connect timeout"
);
fprintf
(
xml
,
"<testcase classname=
\"
test
1
\"
name=
\"
connect timeout
\"
"
);
fprintf
(
xml
,
"<testcase classname=
\"
test
4
\"
name=
\"
connect timeout
\"
"
);
global_start_time
=
start_clock
();
rc
=
MQTTAsync_create
(
&
c
,
"tcp://9.20.96.160:66"
,
"connect timeout"
,
...
...
@@ -491,8 +491,8 @@ exit:
MyLog
(
LOGA_INFO
,
"TEST2: test %s. %d tests run, %d failures."
,
(
failures
==
0
)
?
"passed"
:
"failed"
,
tests
,
failures
);
fprintf
(
xml
,
" time=
\"
%d
\"
>
\n
"
,
elapsed
(
global_start_time
)
/
1000
);
duration
=
elapsed
(
global_start_time
);
fprintf
(
xml
,
" time=
\"
%d
.%.3d
\"
>
\n
"
,
duration
/
1000
,
duration
%
1000
);
if
(
cur_output
!=
output
)
{
fprintf
(
xml
,
output
);
...
...
@@ -656,7 +656,7 @@ int test3(struct Options options)
test_finished
=
0
;
MyLog
(
LOGA_INFO
,
"Starting test 3 - multiple connections"
);
fprintf
(
xml
,
"<testcase classname=
\"
test
1
\"
name=
\"
asynchronous connect
\"
"
);
fprintf
(
xml
,
"<testcase classname=
\"
test
4
\"
name=
\"
asynchronous connect
\"
"
);
global_start_time
=
start_clock
();
for
(
i
=
0
;
i
<
num_clients
;
++
i
)
...
...
@@ -710,7 +710,8 @@ int test3(struct Options options)
exit:
MyLog
(
LOGA_INFO
,
"TEST3: test %s. %d tests run, %d failures."
,
(
failures
==
0
)
?
"passed"
:
"failed"
,
tests
,
failures
);
fprintf
(
xml
,
" time=
\"
%d
\"
>
\n
"
,
elapsed
(
global_start_time
)
/
1000
);
duration
=
elapsed
(
global_start_time
);
fprintf
(
xml
,
" time=
\"
%d.%.3d
\"
>
\n
"
,
duration
/
1000
,
duration
%
1000
);
if
(
cur_output
!=
output
)
{
fprintf
(
xml
,
output
);
...
...
@@ -851,7 +852,7 @@ int test4(struct Options options)
test_finished
=
failures
=
0
;
MyLog
(
LOGA_INFO
,
"Starting test 4 - big messages"
);
fprintf
(
xml
,
"<testcase classname=
\"
test
1
\"
name=
\"
big messages
\"
"
);
fprintf
(
xml
,
"<testcase classname=
\"
test
4
\"
name=
\"
big messages
\"
"
);
global_start_time
=
start_clock
();
rc
=
MQTTAsync_create
(
&
c
,
options
.
connection
,
"async_test_4"
,
...
...
@@ -900,7 +901,8 @@ int test4(struct Options options)
exit:
MyLog
(
LOGA_INFO
,
"TEST4: test %s. %d tests run, %d failures."
,
(
failures
==
0
)
?
"passed"
:
"failed"
,
tests
,
failures
);
fprintf
(
xml
,
" time=
\"
%d
\"
>
\n
"
,
elapsed
(
global_start_time
)
/
1000
);
duration
=
elapsed
(
global_start_time
);
fprintf
(
xml
,
" time=
\"
%d.%.3d
\"
>
\n
"
,
duration
/
1000
,
duration
%
1000
);
if
(
cur_output
!=
output
)
{
fprintf
(
xml
,
output
);
...
...
@@ -953,7 +955,7 @@ int test5(struct Options options)
test_finished
=
failures
=
0
;
MyLog
(
LOGA_INFO
,
"Starting test 5 - connack return codes"
);
fprintf
(
xml
,
"<testcase classname=
\"
test
1
\"
name=
\"
connack return codes
\"
"
);
fprintf
(
xml
,
"<testcase classname=
\"
test
4
\"
name=
\"
connack return codes
\"
"
);
global_start_time
=
start_clock
();
rc
=
MQTTAsync_create
(
&
c
,
options
.
connection
,
"a clientid that is too long to be accepted"
,
...
...
@@ -991,7 +993,8 @@ int test5(struct Options options)
exit:
MyLog
(
LOGA_INFO
,
"TEST5: test %s. %d tests run, %d failures."
,
(
failures
==
0
)
?
"passed"
:
"failed"
,
tests
,
failures
);
fprintf
(
xml
,
" time=
\"
%d
\"
>
\n
"
,
elapsed
(
global_start_time
)
/
1000
);
duration
=
elapsed
(
global_start_time
);
fprintf
(
xml
,
" time=
\"
%d.%.3d
\"
>
\n
"
,
duration
/
1000
,
duration
%
1000
);
if
(
cur_output
!=
output
)
{
fprintf
(
xml
,
output
);
...
...
@@ -1045,7 +1048,7 @@ int test6(struct Options options)
test_finished
=
failures
=
0
;
MyLog
(
LOGA_INFO
,
"Starting test 7 - HA connections"
);
fprintf
(
xml
,
"<testcase classname=
\"
test
1
\"
name=
\"
HA connections
\"
"
);
fprintf
(
xml
,
"<testcase classname=
\"
test
4
\"
name=
\"
HA connections
\"
"
);
global_start_time
=
start_clock
();
rc
=
MQTTAsync_create
(
&
c
,
options
.
connection
,
"a clientid that is too long to be accepted"
,
...
...
@@ -1085,7 +1088,8 @@ int test6(struct Options options)
exit:
MyLog
(
LOGA_INFO
,
"TEST6: test %s. %d tests run, %d failures."
,
(
failures
==
0
)
?
"passed"
:
"failed"
,
tests
,
failures
);
fprintf
(
xml
,
" time=
\"
%d
\"
>
\n
"
,
elapsed
(
global_start_time
)
/
1000
);
duration
=
elapsed
(
global_start_time
);
fprintf
(
xml
,
" time=
\"
%d.%.3d
\"
>
\n
"
,
duration
/
1000
,
duration
%
1000
);
if
(
cur_output
!=
output
)
{
fprintf
(
xml
,
output
);
...
...
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