Commit e00c635ef7139927fece424d10409953724a6c10
1 parent
3905cbe2
Fix tests and warnings
Showing
5 changed files
with
27 additions
and
4 deletions
CMakeLists.txt
FlashMQTests/FlashMQTests.pro
| ... | ... | @@ -28,6 +28,16 @@ SOURCES += tst_maintests.cpp \ |
| 28 | 28 | ../authplugin.cpp \ |
| 29 | 29 | ../session.cpp \ |
| 30 | 30 | ../configfileparser.cpp \ |
| 31 | + ../sslctxmanager.cpp \ | |
| 32 | + ../timer.cpp \ | |
| 33 | + ../iowrapper.cpp \ | |
| 34 | + ../mosquittoauthoptcompatwrap.cpp \ | |
| 35 | + ../settings.cpp \ | |
| 36 | + ../listener.cpp \ | |
| 37 | + ../unscopedlock.cpp \ | |
| 38 | + ../scopedsocket.cpp \ | |
| 39 | + ../bindaddr.cpp \ | |
| 40 | + ../oneinstancelock.cpp \ | |
| 31 | 41 | mainappthread.cpp \ |
| 32 | 42 | twoclienttestcontext.cpp |
| 33 | 43 | |
| ... | ... | @@ -49,9 +59,19 @@ HEADERS += \ |
| 49 | 59 | ../authplugin.h \ |
| 50 | 60 | ../session.h \ |
| 51 | 61 | ../configfileparser.h \ |
| 62 | + ../sslctxmanager.h \ | |
| 63 | + ../timer.h \ | |
| 64 | + ../iowrapper.h \ | |
| 65 | + ../mosquittoauthoptcompatwrap.h \ | |
| 66 | + ../settings.h \ | |
| 67 | + ../listener.h \ | |
| 68 | + ../unscopedlock.h \ | |
| 69 | + ../scopedsocket.h \ | |
| 70 | + ../bindaddr.h \ | |
| 71 | + ../oneinstancelock.h \ | |
| 52 | 72 | mainappthread.h \ |
| 53 | 73 | twoclienttestcontext.h |
| 54 | 74 | |
| 55 | -LIBS += -ldl | |
| 75 | +LIBS += -ldl -lssl -lcrypto | |
| 56 | 76 | |
| 57 | 77 | QMAKE_LFLAGS += -rdynamic | ... | ... |
logger.cpp
utils.cpp
| ... | ... | @@ -207,10 +207,10 @@ int64_t currentMSecsSinceEpoch() |
| 207 | 207 | return milliseconds; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | -std::string getSecureRandomString(const size_t len) | |
| 210 | +std::string getSecureRandomString(const ssize_t len) | |
| 211 | 211 | { |
| 212 | 212 | std::vector<char> buf(len); |
| 213 | - size_t actual_len = getrandom(buf.data(), len, 0); | |
| 213 | + ssize_t actual_len = getrandom(buf.data(), len, 0); | |
| 214 | 214 | |
| 215 | 215 | if (actual_len < 0 || actual_len != len) |
| 216 | 216 | { | ... | ... |
utils.h
| ... | ... | @@ -45,7 +45,7 @@ void trim(std::string &s); |
| 45 | 45 | bool startsWith(const std::string &s, const std::string &needle); |
| 46 | 46 | |
| 47 | 47 | int64_t currentMSecsSinceEpoch(); |
| 48 | -std::string getSecureRandomString(const size_t len); | |
| 48 | +std::string getSecureRandomString(const ssize_t len); | |
| 49 | 49 | std::string str_tolower(std::string s); |
| 50 | 50 | bool stringTruthiness(const std::string &val); |
| 51 | 51 | bool isPowerOfTwo(int val); | ... | ... |