#include <unistd.h>
#include <boost/test/unit_test.hpp>
+#include <boost/test/auto_unit_test.hpp>
#include "mymediaverifier.h"
using boost::unit_test::test_suite;
using boost::unit_test::test_case;
+BOOST_AUTO_TEST_CASE(curl_params_reset)
+{
+ MediaManager mm;
+ media::MediaId id;
+
+ Url url("http://ftp.kernel.org/pub/");
+
+ id = mm.open( url, "");
+ mm.attach(id);
+
+ Pathname dest;
+ Pathname src("/README");
+ mm.doesFileExist(id, src);
+ mm.provideFile(id, src);
+ dest = mm.localPath(id, src);
+ BOOST_REQUIRE( PathInfo(dest).size() != 0 );
+
+ mm.doesFileExist(id, src);
+ mm.provideFile(id, src);
+ dest = mm.localPath(id, src);
+ BOOST_REQUIRE( PathInfo(dest).size() != 0 );
+
+ mm.doesFileExist(id, src);
+ mm.provideFile(id, src);
+ dest = mm.localPath(id, src);
+ BOOST_REQUIRE( PathInfo(dest).size() != 0 );
+
+ mm.doesFileExist(id, src);
+ mm.provideFile(id, src);
+ dest = mm.localPath(id, src);
+ BOOST_CHECK_EQUAL( PathInfo(dest).size() , 1 );
+
+ mm.release(id);
+}
+
BOOST_AUTO_TEST_CASE(http_test)
{
//MediaVerifierRef verifier( new MyMediaVerifier() );
mm.release(id);
}
-void ftp_test()
+BOOST_AUTO_TEST_CASE(ftp_test)
{
//MediaVerifierRef verifier( new MyMediaVerifier() );
MediaManager mm;
{
if ( geteuid() != 0 )
{
- BOOST_ERROR( "ISO test requires root permissions! (mount)");
+ BOOST_WARN( "ISO test requires root permissions! (mount)");
return;
}
{
if ( geteuid() != 0 )
{
- BOOST_ERROR( "NFS test requires root permissions! (mount)");
+ BOOST_WARN( "NFS test requires root permissions! (mount)");
return;
}
#include <unistd.h>
#include <boost/test/unit_test.hpp>
+#include <boost/test/auto_unit_test.hpp>
#include "mymediaverifier.h"
using boost::unit_test::test_suite;
using boost::unit_test::test_case;
-void http_test()
+BOOST_AUTO_TEST_CASE(http_test)
{
//MediaVerifierRef verifier( new MyMediaVerifier() );
MediaManager mm;
mm.release(id);
}
-test_suite*
-init_unit_test_suite( int, char* [] )
-{
- test_suite* test= BOOST_TEST_SUITE( "throw_if_not_exists" );
- //test->add( BOOST_TEST_CASE( &nfs_test ), 0 /* expected zero error */ );
- test->add( BOOST_TEST_CASE( &http_test ), 0 /* expected zero error */ );
- //test->add( BOOST_TEST_CASE( &ftp_test ), 0 /* expected zero error */ );
- //test->add( BOOST_TEST_CASE( &iso_test ), 0 /* expected zero error */ );
- //test->add( BOOST_TEST_CASE( &nfs_test ), 0 /* expected zero error */ );
- return test;
-}
-
-
-
// vim: set ts=2 sts=2 sw=2 ai et: