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
8276dcd2
Commit
8276dcd2
authored
Feb 26, 2018
by
Ian Craggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for wrong protocol name #294
parent
d1d6496d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
test3.c
test/test3.c
+3
-0
test5.c
test/test5.c
+4
-0
No files found.
test/test3.c
View file @
8276dcd2
...
@@ -571,6 +571,9 @@ int test1(struct Options options)
...
@@ -571,6 +571,9 @@ int test1(struct Options options)
fprintf
(
xml
,
"<testcase classname=
\"
test3
\"
name=
\"
SSL connect fail to nonSSL MQTT server
\"
"
);
fprintf
(
xml
,
"<testcase classname=
\"
test3
\"
name=
\"
SSL connect fail to nonSSL MQTT server
\"
"
);
global_start_time
=
start_clock
();
global_start_time
=
start_clock
();
rc
=
MQTTClient_create
(
&
c
,
"a b://wrong protocol"
,
"test1"
,
MQTTCLIENT_PERSISTENCE_DEFAULT
,
persistenceStore
);
assert
(
"bad rc from create"
,
rc
==
MQTTCLIENT_BAD_PROTOCOL
,
"rc was %d
\n
"
,
rc
);
rc
=
MQTTClient_create
(
&
c
,
options
.
connection
,
"test1"
,
MQTTCLIENT_PERSISTENCE_DEFAULT
,
persistenceStore
);
rc
=
MQTTClient_create
(
&
c
,
options
.
connection
,
"test1"
,
MQTTCLIENT_PERSISTENCE_DEFAULT
,
persistenceStore
);
if
(
!
(
assert
(
"good rc from create"
,
rc
==
MQTTCLIENT_SUCCESS
,
"rc was %d
\n
"
,
rc
)))
if
(
!
(
assert
(
"good rc from create"
,
rc
==
MQTTCLIENT_SUCCESS
,
"rc was %d
\n
"
,
rc
)))
goto
exit
;
goto
exit
;
...
...
test/test5.c
View file @
8276dcd2
...
@@ -613,6 +613,10 @@ int test1(struct Options options)
...
@@ -613,6 +613,10 @@ int test1(struct Options options)
fprintf
(
xml
,
"<testcase classname=
\"
test5
\"
name=
\"
%s
\"
"
,
testname
);
fprintf
(
xml
,
"<testcase classname=
\"
test5
\"
name=
\"
%s
\"
"
,
testname
);
global_start_time
=
start_clock
();
global_start_time
=
start_clock
();
rc
=
MQTTAsync_create
(
&
c
,
"rubbish://wrong"
,
"test1"
,
MQTTCLIENT_PERSISTENCE_DEFAULT
,
NULL
);
assert
(
"bad rc from create"
,
rc
==
MQTTASYNC_BAD_PROTOCOL
,
"rc was %d
\n
"
,
rc
);
rc
=
MQTTAsync_create
(
&
c
,
options
.
connection
,
"test1"
,
MQTTCLIENT_PERSISTENCE_DEFAULT
,
rc
=
MQTTAsync_create
(
&
c
,
options
.
connection
,
"test1"
,
MQTTCLIENT_PERSISTENCE_DEFAULT
,
NULL
);
NULL
);
assert
(
"good rc from create"
,
rc
==
MQTTASYNC_SUCCESS
,
"rc was %d
\n
"
,
rc
);
assert
(
"good rc from create"
,
rc
==
MQTTASYNC_SUCCESS
,
"rc was %d
\n
"
,
rc
);
...
...
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