#include "SessionSerializer.h" #include #include #include #include "RequestGroupMan.h" #include "array_fun.h" #include "download_helper.h" #include "prefs.h" #include "Option.h" #include "a2functional.h" #include "FileEntry.h" namespace aria2 { class SessionSerializerTest:public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(SessionSerializerTest); CPPUNIT_TEST(testSave); CPPUNIT_TEST_SUITE_END(); public: void testSave(); }; CPPUNIT_TEST_SUITE_REGISTRATION(SessionSerializerTest); namespace { SharedHandle createDownloadResult (error_code::Value result, const std::string& uri) { std::vector uris; uris.push_back(uri); SharedHandle entry(new FileEntry("/tmp/path", 1, 0, uris)); std::vector > entries; entries.push_back(entry); SharedHandle dr(new DownloadResult()); dr->fileEntries = entries; dr->result = result; dr->belongsTo = 0; dr->inMemoryDownload = false; dr->option = SharedHandle