2023-12-23 13:59:58 +01:00
|
|
|
#include <mosquitto/libmosquittopp.h>
|
2023-01-02 12:42:57 +01:00
|
|
|
#include "path_helper.h"
|
2014-05-08 00:27:00 +02:00
|
|
|
|
|
|
|
|
class mosquittopp_test : public mosqpp::mosquittopp
|
|
|
|
|
{
|
2025-09-17 12:19:46 +02:00
|
|
|
public:
|
|
|
|
|
mosquittopp_test(const char *id);
|
2014-05-08 00:27:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-17 12:19:46 +02:00
|
|
|
|
2014-05-08 00:27:00 +02:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
{
|
2024-02-26 01:19:49 +01:00
|
|
|
mosquittopp_test *mosq;
|
2014-05-08 00:27:00 +02:00
|
|
|
int rc = 1;
|
|
|
|
|
|
2025-08-24 00:15:16 +02:00
|
|
|
if(argc != 2){
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2023-01-02 12:42:57 +01:00
|
|
|
(void)argv;
|
|
|
|
|
|
2014-05-08 00:27:00 +02:00
|
|
|
mosqpp::lib_init();
|
|
|
|
|
|
|
|
|
|
mosq = new mosquittopp_test("08-ssl-bad-cacert");
|
|
|
|
|
|
|
|
|
|
if(mosq->tls_set("this/file/doesnt/exist") == MOSQ_ERR_INVAL){
|
|
|
|
|
rc = 0;
|
|
|
|
|
}
|
2020-05-05 12:56:10 +02:00
|
|
|
delete mosq;
|
2014-05-08 00:27:00 +02:00
|
|
|
mosqpp::lib_cleanup();
|
|
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
|
}
|