|
|
|
@ -20,6 +20,9 @@ static void no_match_helper(int rc_expected, const char *sub, const char *topic)
|
|
|
|
|
|
|
|
|
|
rc = mosquitto_topic_matches_sub(sub, topic, &match);
|
|
|
|
|
CU_ASSERT_EQUAL(rc, rc_expected);
|
|
|
|
|
if(rc != rc_expected){
|
|
|
|
|
printf("%d:%d %s:%s\n", rc, rc_expected, sub, topic);
|
|
|
|
|
}
|
|
|
|
|
CU_ASSERT_EQUAL(match, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -135,6 +138,16 @@ static void TEST_invalid_but_matching(void)
|
|
|
|
|
no_match_helper(MOSQ_ERR_INVAL, "foo/bar#", "foo/bar#");
|
|
|
|
|
|
|
|
|
|
no_match_helper(MOSQ_ERR_INVAL, "foo+", "fooa");
|
|
|
|
|
|
|
|
|
|
no_match_helper(MOSQ_ERR_INVAL, "foo/+", "foo/+");
|
|
|
|
|
no_match_helper(MOSQ_ERR_INVAL, "foo/#", "foo/+");
|
|
|
|
|
no_match_helper(MOSQ_ERR_INVAL, "foo/+", "foo/bar/+");
|
|
|
|
|
no_match_helper(MOSQ_ERR_INVAL, "foo/#", "foo/bar/+");
|
|
|
|
|
|
|
|
|
|
no_match_helper(MOSQ_ERR_INVAL, "foo/+", "foo/#");
|
|
|
|
|
no_match_helper(MOSQ_ERR_INVAL, "foo/#", "foo/#");
|
|
|
|
|
no_match_helper(MOSQ_ERR_INVAL, "foo/+", "foo/bar/#");
|
|
|
|
|
no_match_helper(MOSQ_ERR_INVAL, "foo/#", "foo/bar/#");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|