summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-05-26 15:28:48 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-05-26 15:28:48 +0000
commit41df4b5e2801a6bb960dcc27b43af46bf6a7010f (patch)
treeb26a98badecae6f189b405bd08fff5de2244062e /test
parent544732b124335cac5a390634da04d2ef63becd88 (diff)
2009-05-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use name.utf-8 and path.utf-8 key in higher priority than name and path key respectively when persing .torrent file. * src/BtContext.cc * src/BtContext.h * src/DefaultBtContext.cc * test/DefaultBtContextTest.cc * test/utf8.torrent
Diffstat (limited to 'test')
-rw-r--r--test/DefaultBtContextTest.cc11
-rw-r--r--test/utf8.torrent1
2 files changed, 12 insertions, 0 deletions
diff --git a/test/DefaultBtContextTest.cc b/test/DefaultBtContextTest.cc
index 0966d918..10375d13 100644
--- a/test/DefaultBtContextTest.cc
+++ b/test/DefaultBtContextTest.cc
@@ -46,6 +46,7 @@ class DefaultBtContextTest:public CppUnit::TestFixture {
CPPUNIT_TEST(testGetActualBasePath);
CPPUNIT_TEST(testSetFileFilter_single);
CPPUNIT_TEST(testSetFileFilter_multi);
+ CPPUNIT_TEST(testUTF8Torrent);
CPPUNIT_TEST_SUITE_END();
public:
void setUp() {
@@ -80,6 +81,7 @@ public:
void testGetActualBasePath();
void testSetFileFilter_single();
void testSetFileFilter_multi();
+ void testUTF8Torrent();
};
@@ -596,4 +598,13 @@ void DefaultBtContextTest::testSetFileFilter_multi()
CPPUNIT_ASSERT(ctx.getFileEntries()[1]->isRequested());
}
+void DefaultBtContextTest::testUTF8Torrent()
+{
+ DefaultBtContext ctx;
+ ctx.load("utf8.torrent");
+ CPPUNIT_ASSERT_EQUAL(std::string("name in utf-8"), ctx.getName());
+ CPPUNIT_ASSERT_EQUAL(std::string("./name in utf-8/path in utf-8"),
+ ctx.getFileEntries()[0]->getPath());
+}
+
} // namespace aria2
diff --git a/test/utf8.torrent b/test/utf8.torrent
new file mode 100644
index 00000000..6f26f52f
--- /dev/null
+++ b/test/utf8.torrent
@@ -0,0 +1 @@
+d8:announce36:http://aria.rednoah.com/announce.php13:announce-listll16:http://tracker1 el15:http://tracker2el15:http://tracker3ee7:privatei1e7:comment17:REDNOAH.COM RULES13:creation datei1123456789e4:infod5:filesld6:lengthi284e4:pathl5:aria23:src6:aria2ce10:path.utf-8l13:path in utf-8eed6:lengthi100e4:pathl19:aria2-0.2.2.tar.bz2eee4:name10:aria2-test10:name.utf-813:name in utf-812:piece lengthi128e6:pieces60:AAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCee \ No newline at end of file