Commit cf1c8f18 authored by louiz’'s avatar louiz’
Browse files

Remove a few warnings occuring in some build config

parent 154c12f3
...@@ -25,6 +25,8 @@ static std::string in_encoding_for(const Bridge& bridge, const Iid& iid) ...@@ -25,6 +25,8 @@ static std::string in_encoding_for(const Bridge& bridge, const Iid& iid)
auto options = Database::get_irc_channel_options_with_server_default(jid, iid.get_server(), iid.get_local()); auto options = Database::get_irc_channel_options_with_server_default(jid, iid.get_server(), iid.get_local());
return options.encodingIn.value(); return options.encodingIn.value();
#else #else
(void)bridge;
(void)iid;
return {"ISO-8859-1"}; return {"ISO-8859-1"};
#endif #endif
} }
...@@ -1000,6 +1002,10 @@ void Bridge::send_room_history(const std::string& hostname, std::string chan_nam ...@@ -1000,6 +1002,10 @@ void Bridge::send_room_history(const std::string& hostname, std::string chan_nam
this->xmpp.send_history_message(chan_name, line.nick.value(), line.body.value(), this->xmpp.send_history_message(chan_name, line.nick.value(), line.body.value(),
this->user_jid + "/" + resource, seconds); this->user_jid + "/" + resource, seconds);
} }
#else
(void)hostname;
(void)chan_name;
(void)resource;
#endif #endif
} }
......
...@@ -30,15 +30,16 @@ TEST_CASE("Test basic XML parsing") ...@@ -30,15 +30,16 @@ TEST_CASE("Test basic XML parsing")
// And do the same checks on moved-constructed stanza // And do the same checks on moved-constructed stanza
Stanza moved(std::move(copy)); Stanza moved(std::move(copy));
}); });
xml.feed(doc.data(), doc.size(), true); CHECK(doc.size() <= std::numeric_limits<int>::max());
xml.feed(doc.data(), static_cast<int>(doc.size()), true);
const std::string doc2 = "<stream xmlns='s'><stanza>coucou\r\n\a</stanza></stream>"; const std::string doc2 = "<stream xmlns='s'><stanza>coucou\r\n\a</stanza></stream>";
xml.add_stanza_callback([](const Stanza& stanza) xml.add_stanza_callback([](const Stanza& stanza)
{ {
CHECK(stanza.get_inner() == "coucou\r\n"); CHECK(stanza.get_inner() == "coucou\r\n");
}); });
CHECK(doc.size() <= std::numeric_limits<int>::max());
xml.feed(doc2.data(), doc.size(), true); xml.feed(doc2.data(), static_cast<int>(doc.size()), true);
} }
TEST_CASE("XML escape") TEST_CASE("XML escape")
...@@ -68,4 +69,4 @@ TEST_CASE("substanzas") ...@@ -68,4 +69,4 @@ TEST_CASE("substanzas")
CHECK(b.has_children()); CHECK(b.has_children());
} }
CHECK(a.has_children()); CHECK(a.has_children());
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment