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
bd954ae7
Commit
bd954ae7
authored
Jul 18, 2013
by
Ian Craggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make test 3 pass
parent
ef16f95a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
test1.c
test/test1.c
+9
-11
No files found.
test/test1.c
View file @
bd954ae7
...
...
@@ -570,26 +570,26 @@ int test3(struct Options options)
int
rc
;
MQTTClient
c
;
MQTTClient_connectOptions
opts
=
MQTTClient_connectOptions_initializer
;
/* TODO - unused - remove? MQTTClient_willOptions wopts = MQTTClient_willOptions_initializer; */
MQTTClient_willOptions
wopts
=
MQTTClient_willOptions_initializer
;
fprintf
(
xml
,
"<testcase classname=
\"
test1
\"
name=
\"
connack return codes
\"
"
);
global_start_time
=
start_clock
();
failures
=
0
;
MyLog
(
LOGA_INFO
,
"Starting test 3 - connack return codes"
);
#if 0
/* clientid too long (RC = 2) */
rc = MQTTClient_create(&c, options.connection, "client_ID_too_long_for_MQTT_protocol_version_3",
MQTTCLIENT_PERSISTENCE_NONE
,
NULL
);
MQTTCLIENT_PERSISTENCE_NONE, NULL);
assert("good rc from create", rc == MQTTCLIENT_SUCCESS, "rc was %d\n", rc);
rc = MQTTClient_connect(c, &opts);
assert("identifier rejected", rc == 2, "rc was %d\n", rc);
MQTTClient_destroy(&c);
#if 0
#endif
/* broker unavailable (RC = 3) - TDD when allow_anonymous not set*/
rc = MQTTClient_create(&c,
"127.0.0.1:1883"
, "The C Client", MQTTCLIENT_PERSISTENCE_NONE, NULL);
rc
=
MQTTClient_create
(
&
c
,
options
.
connection
,
"The C Client"
,
MQTTCLIENT_PERSISTENCE_NONE
,
NULL
);
assert
(
"good rc from create"
,
rc
==
MQTTCLIENT_SUCCESS
,
"rc was %d
\n
"
,
rc
);
#if 0
rc = MQTTClient_connect(c, &opts);
assert("broker unavailable", rc == 3, "rc was %d\n", rc);
...
...
@@ -600,18 +600,16 @@ int test3(struct Options options)
assert("Bad user name or password", rc == 4, "rc was %d\n", rc);
#endif
#if defined(MICROBROKER)
/* authorization failure (RC = 5) */
opts
.
username
=
"Admin"
;
opts
.
password
=
"Admin"
;
opts
.
will
=
&
wopts
;
/* "Admin" not authorized to publish to Will topic by default */
/*opts.will = &wopts; /* "Admin" not authorized to publish to Will topic by default
opts.will->message = "will message";
opts.will->qos = 1;
opts.will->retained = 0;
opts
.
will
->
topicName
=
"will topic"
;
opts.will->topicName = "will topic";
*/
rc
=
MQTTClient_connect
(
c
,
&
opts
);
assert
(
"Not authorized"
,
rc
==
5
,
"rc was %d
\n
"
,
rc
);
#endif
//assert("Not authorized", rc == 5, "rc was %d\n", rc);
#if 0
/* successful connection (RC = 0) */
...
...
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