From 03424dd1ce6b2939898ef0767a0719436c07f4b4 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 23 Jan 2010 10:11:26 +0000 Subject: [PATCH] 2010-01-23 Tatsuhiro Tsujikawa Fixed test error without BitTorrent support. * test/XmlRpcMethodTest.cc --- ChangeLog | 5 +++++ test/XmlRpcMethodTest.cc | 25 +++---------------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5f21d173..ddfb8aeb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-23 Tatsuhiro Tsujikawa + + Fixed test error without BitTorrent support. + * test/XmlRpcMethodTest.cc + 2010-01-23 Tatsuhiro Tsujikawa Fixed compile error without GNUTLS/OpenSSL. diff --git a/test/XmlRpcMethodTest.cc b/test/XmlRpcMethodTest.cc index db620d64..6408ee8b 100644 --- a/test/XmlRpcMethodTest.cc +++ b/test/XmlRpcMethodTest.cc @@ -574,7 +574,9 @@ void XmlRpcMethodTest::testTellWaiting() addUri("http://3/", _e); #ifdef ENABLE_BITTORRENT addTorrent("single.torrent", _e); -#endif // ENABLE_BITTORRENT +#else // !ENABLE_BITTORRENT + addUri("http://4/", _e); +#endif // !ENABLE_BITTORRENT TellWaitingXmlRpcMethod m; XmlRpcRequest req(TellWaitingXmlRpcMethod::getMethodName(), BDE::list()); @@ -588,29 +590,17 @@ void XmlRpcMethodTest::testTellWaiting() // waiting.size() == offset+num req = XmlRpcRequest(TellWaitingXmlRpcMethod::getMethodName(), BDE::list()); req._params << BDE((int64_t)1); -#ifdef ENABLE_BITTORRENT req._params << BDE((int64_t)3); -#else // !ENABLE_BITTORRENT - req._params << BDE((int64_t)2); -#endif // !ENABLE_BITTORRENT res = m.execute(req, _e.get()); CPPUNIT_ASSERT_EQUAL(0, res._code); -#ifdef ENABLE_BITTORRENT CPPUNIT_ASSERT_EQUAL((size_t)3, res._param.size()); -#else // !ENABLE_BITTORRENT - CPPUNIT_ASSERT_EQUAL((size_t)2, res._param.size()); -#endif // !ENABLE_BITTORRENT // waiting.size() < offset+num req = XmlRpcRequest(TellWaitingXmlRpcMethod::getMethodName(), BDE::list()); req._params << BDE((int64_t)1); req._params << BDE((int64_t)4); res = m.execute(req, _e.get()); CPPUNIT_ASSERT_EQUAL(0, res._code); -#ifdef ENABLE_BITTORRENT CPPUNIT_ASSERT_EQUAL((size_t)3, res._param.size()); -#else //!ENABLE_BITTORRENT - CPPUNIT_ASSERT_EQUAL((size_t)2, res._param.size()); -#endif // !ENABLE_BITTORRENT // negative offset req = XmlRpcRequest(TellWaitingXmlRpcMethod::getMethodName(), BDE::list()); req._params << BDE((int64_t)-1); @@ -618,22 +608,13 @@ void XmlRpcMethodTest::testTellWaiting() res = m.execute(req, _e.get()); CPPUNIT_ASSERT_EQUAL(0, res._code); CPPUNIT_ASSERT_EQUAL((size_t)2, res._param.size()); -#ifdef ENABLE_BITTORRENT CPPUNIT_ASSERT_EQUAL(std::string("4"), res._param[0]["gid"].s()); CPPUNIT_ASSERT_EQUAL(std::string("3"), res._param[1]["gid"].s()); -#else // !ENABLE_BITTORRENT - CPPUNIT_ASSERT_EQUAL(std::string("3"), res._param[0]["gid"].s()); - CPPUNIT_ASSERT_EQUAL(std::string("2"), res._param[1]["gid"].s()); -#endif // !ENABLE_BITTORRENT // negative offset and size < num req._params[1] = BDE((int64_t)100); res = m.execute(req, _e.get()); CPPUNIT_ASSERT_EQUAL(0, res._code); -#ifdef ENABLE_BITTORRENT CPPUNIT_ASSERT_EQUAL((size_t)4, res._param.size()); -#else // !ENABLE_BITTORRENT - CPPUNIT_ASSERT_EQUAL((size_t)3, res._param.size()); -#endif // !ENABLE_BITTORRENT // nagative offset and normalized offset < 0 req._params[0] = BDE((int64_t)-5); res = m.execute(req, _e.get());