diff --git a/test/test_rss.cpp b/test/test_rss.cpp index a2a4fed18..71d274bf2 100644 --- a/test/test_rss.cpp +++ b/test/test_rss.cpp @@ -85,7 +85,7 @@ void test_feed(std::string const& filename, rss_expect const& expect) } TEST_CHECK(!ec); - char* buf = &buffer[0]; + char* buf = buffer.size() ? &buffer[0] : NULL; int len = buffer.size(); char const header[] = "HTTP/1.1 200 OK\r\n" diff --git a/test/test_torrent_parse.cpp b/test/test_torrent_parse.cpp index 0b73ace0f..15912cb85 100644 --- a/test/test_torrent_parse.cpp +++ b/test/test_torrent_parse.cpp @@ -121,7 +121,9 @@ int test_main() if (std::string(test_torrents[i].file) == "whitespace_url.torrent") { // make sure we trimmed the url - TEST_CHECK(ti->trackers()[0].url == "udp://test.com/announce"); + TEST_CHECK(ti->trackers().size() > 0); + if (ti->trackers().size() > 0) + TEST_CHECK(ti->trackers()[0].url == "udp://test.com/announce"); } else if (std::string(test_torrents[i].file) == "duplicate_files.torrent") {