windows build fixes (and one msvc warning fix)

This commit is contained in:
Arvid Norberg
2009-07-20 01:54:51 +00:00
parent c0b83375bf
commit 310b9d0e51
3 changed files with 14 additions and 5 deletions

View File

@@ -85,7 +85,7 @@ tuple<int, int, bool> feed_bytes(http_parser& parser, char const* str)
tie(payload, protocol) = parser.incoming(recv_buf, error);
ret.get<0>() += payload;
ret.get<1>() += protocol;
ret.get<2>() += error;
ret.get<2>() |= error;
// std::cerr << payload << ", " << protocol << ", " << chunk_size << std::endl;
TORRENT_ASSERT(payload + protocol == chunk_size);
}
@@ -359,6 +359,12 @@ int test_main()
{
using namespace libtorrent;
// test snprintf
char msg[10];
snprintf(msg, sizeof(msg), "too %s format string", "long");
TEST_CHECK(strcmp(msg, "too long ") == 0);
// test maybe_url_encode
TEST_CHECK(maybe_url_encode("http://test:test@abc.com/abc<>abc") == "http://test:test@abc.com:80/abc%3c%3eabc");