Dokan changes
This commit is contained in:
@@ -20,6 +20,46 @@ namespace UnitTests
|
||||
CSiaApi api(_hostConfig);
|
||||
Assert::IsTrue(api.GetServerVersion() == TEST_SERVER_VERSION);
|
||||
}
|
||||
|
||||
TEST_METHOD(RelativePathToSiaPath)
|
||||
{
|
||||
String relPath = L"test\\moose\\cow.txt";
|
||||
String siaPath = CSiaApi::FormatToSiaPath(relPath);
|
||||
|
||||
Assert::AreEqual(L"test/moose/cow.txt", siaPath.c_str());
|
||||
}
|
||||
|
||||
TEST_METHOD(RelativePathWithBeginningBackslashToSiaPath)
|
||||
{
|
||||
String relPath = L"\\test\\moose\\cow.txt";
|
||||
String siaPath = CSiaApi::FormatToSiaPath(relPath);
|
||||
|
||||
Assert::AreEqual(L"test/moose/cow.txt", siaPath.c_str());
|
||||
}
|
||||
|
||||
TEST_METHOD(RelativePathWithBeginningBackslashOnlyToSiaPath)
|
||||
{
|
||||
String relPath = L"\\";
|
||||
String siaPath = CSiaApi::FormatToSiaPath(relPath);
|
||||
|
||||
Assert::AreEqual(L"", siaPath.c_str());
|
||||
}
|
||||
|
||||
TEST_METHOD(FilenameOnlyToSiaPath)
|
||||
{
|
||||
String relPath = L"moose.txt";
|
||||
String siaPath = CSiaApi::FormatToSiaPath(relPath);
|
||||
|
||||
Assert::AreEqual(L"moose.txt", siaPath.c_str());
|
||||
}
|
||||
|
||||
TEST_METHOD(RemoveExtraBackslashes)
|
||||
{
|
||||
String relPath = L"\\\\\\\\test\\\\\\\\\\\\\\\\\\moose\\\\\\\\\\\\cow.txt";
|
||||
String siaPath = CSiaApi::FormatToSiaPath(relPath);
|
||||
|
||||
Assert::AreEqual(L"test/moose/cow.txt", siaPath.c_str());
|
||||
}
|
||||
};
|
||||
|
||||
DEFINE_DAEMON(SiaApi);
|
||||
|
Reference in New Issue
Block a user