mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Split unit tests to separate files
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
// VFALCO TODO Repalce these with something more robust and without macros.
|
||||
//
|
||||
#if !defined(WIN32) && !defined(WIN64)
|
||||
#define _vsnprintf(a,b,c,d) vsnprintf(a,b,c,d)
|
||||
#endif
|
||||
@@ -259,53 +261,3 @@ bool parseQuality (const std::string& strSource, uint32& uQuality)
|
||||
|
||||
return !!uQuality;
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE ( Utils)
|
||||
|
||||
BOOST_AUTO_TEST_CASE ( ParseUrl )
|
||||
{
|
||||
std::string strScheme;
|
||||
std::string strDomain;
|
||||
int iPort;
|
||||
std::string strPath;
|
||||
|
||||
if (!parseUrl ("lower://domain", strScheme, strDomain, iPort, strPath))
|
||||
BOOST_FAIL ("parseUrl: lower://domain failed");
|
||||
|
||||
if (strScheme != "lower")
|
||||
BOOST_FAIL ("parseUrl: lower://domain : scheme failed");
|
||||
|
||||
if (strDomain != "domain")
|
||||
BOOST_FAIL ("parseUrl: lower://domain : domain failed");
|
||||
|
||||
if (iPort != -1)
|
||||
BOOST_FAIL ("parseUrl: lower://domain : port failed");
|
||||
|
||||
if (strPath != "")
|
||||
BOOST_FAIL ("parseUrl: lower://domain : path failed");
|
||||
|
||||
if (!parseUrl ("UPPER://domain:234/", strScheme, strDomain, iPort, strPath))
|
||||
BOOST_FAIL ("parseUrl: UPPER://domain:234/ failed");
|
||||
|
||||
if (strScheme != "upper")
|
||||
BOOST_FAIL ("parseUrl: UPPER://domain:234/ : scheme failed");
|
||||
|
||||
if (iPort != 234)
|
||||
BOOST_FAIL (boost::str (boost::format ("parseUrl: UPPER://domain:234/ : port failed: %d") % iPort));
|
||||
|
||||
if (strPath != "/")
|
||||
BOOST_FAIL ("parseUrl: UPPER://domain:234/ : path failed");
|
||||
|
||||
if (!parseUrl ("Mixed://domain/path", strScheme, strDomain, iPort, strPath))
|
||||
BOOST_FAIL ("parseUrl: Mixed://domain/path failed");
|
||||
|
||||
if (strScheme != "mixed")
|
||||
BOOST_FAIL ("parseUrl: Mixed://domain/path tolower failed");
|
||||
|
||||
if (strPath != "/path")
|
||||
BOOST_FAIL ("parseUrl: Mixed://domain/path path failed");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END ()
|
||||
|
||||
// vim:ts=4
|
||||
|
||||
Reference in New Issue
Block a user