Added new testcase

pull/1/head
Tatsuhiro Tsujikawa 2007-08-28 15:48:05 +00:00
parent f62a1dff8a
commit 917e69793c
1 changed files with 32 additions and 0 deletions

32
test/RequestGroupTest.cc Normal file
View File

@ -0,0 +1,32 @@
#include "RequestGroup.h"
#include "prefs.h"
#include <cppunit/extensions/HelperMacros.h>
using namespace std;
class RequestGroupTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(RequestGroupTest);
CPPUNIT_TEST(testTryAutoFileRenaming);
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp() {}
void testTryAutoFileRenaming();
};
CPPUNIT_TEST_SUITE_REGISTRATION( RequestGroupTest );
void RequestGroupTest::testTryAutoFileRenaming()
{
Option op;
op.put(PREF_DIR, ".");
RequestGroup rg("http://localhost/RequestGroupTest.cc", &op);
rg.setUserDefinedFilename("RequestGroupTest.cc");
rg.initSegmentMan();
CPPUNIT_ASSERT(rg.tryAutoFileRenaming());
CPPUNIT_ASSERT_EQUAL(string("./RequestGroupTest.cc.1"), rg.getFilePath());
}