2006-11-07 22:03:13 +01:00
|
|
|
#include "lib/self_test.h"
|
|
|
|
|
|
|
|
#include "ps/XML/Xeromyces.h"
|
|
|
|
#include "lib/res/file/vfs.h"
|
|
|
|
#include "lib/res/file/path.h"
|
2006-12-20 04:09:21 +01:00
|
|
|
#include "lib/res/h_mgr.h"
|
2006-11-07 22:03:13 +01:00
|
|
|
|
|
|
|
class TestXeromyces : public CxxTest::TestSuite
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void test_paths()
|
|
|
|
{
|
2006-12-20 04:09:21 +01:00
|
|
|
TS_ASSERT_OK(file_init());
|
|
|
|
TS_ASSERT_OK(file_set_root_dir(0, "../data"));
|
2006-11-07 22:03:13 +01:00
|
|
|
vfs_init();
|
|
|
|
|
2006-12-20 04:09:21 +01:00
|
|
|
TS_ASSERT_OK(vfs_mount("", "mods/_test.xero", VFS_MOUNT_RECURSIVE));
|
|
|
|
TS_ASSERT_OK(vfs_set_write_target("mods/_test.xero"));
|
2006-11-07 22:03:13 +01:00
|
|
|
|
|
|
|
char xmbPath[PATH_MAX];
|
|
|
|
|
|
|
|
CXeromyces::GetXMBPath("test1.xml", "test1.xmb", xmbPath);
|
2006-12-20 04:09:21 +01:00
|
|
|
TS_ASSERT_STR_EQUALS(xmbPath, "cache/mods/_test.xero/xmb/test1.xmb");
|
2006-11-07 22:03:13 +01:00
|
|
|
|
|
|
|
CXeromyces::GetXMBPath("a/b/test1.xml", "a/b/test1.xmb", xmbPath);
|
2006-12-20 04:09:21 +01:00
|
|
|
TS_ASSERT_STR_EQUALS(xmbPath, "cache/mods/_test.xero/xmb/a/b/test1.xmb");
|
2006-11-07 22:03:13 +01:00
|
|
|
|
|
|
|
vfs_shutdown();
|
|
|
|
path_reset_root_dir();
|
2006-12-20 04:09:21 +01:00
|
|
|
TS_ASSERT_OK(file_shutdown());
|
2006-11-07 22:03:13 +01:00
|
|
|
}
|
|
|
|
};
|