/* Tests for int to string functions. */ #include #include #include "mosquitto.h" static void TEST_mosquitto_strerror(void) { const char *str; int used[] = {-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, /* 13, */ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 31, 32, 128, 131, 133, 134, 136, 137, 138, 140, 142, 147, 148, 152, 154, 159}; /* Iterate over all possible errors, checking we have a place holder for all * unused errors, and that all used errors do not have place holder text. */ for(int err=-256; err<256; err++){ str = mosquitto_strerror(err); CU_ASSERT_PTR_NOT_NULL(str); if(str){ bool is_used = false; for(size_t i=0; i