forked from 0ad/0ad
Ykkrosh
8b7d1fcfb3
* Changed log files to trigger standards mode in Firefox (to be consistent with other browsers), by making it valid HTML5. Changed the font and some spacing. * Made CLogger default to ignoring messages if it hasn't been initialised yet, instead of crashing. * Added leak reporting to the unit tests. * Renamed mods/_tests to mods/_test.xero, since it's only used by Xeromyces and the other tests use mods/_test.otherstuff instead. * Fixed Atlas compilation on Windows. * Moved Atlas's DLL-loading code into a separate class, so it can be shared. This was SVN commit r4707.
35 lines
891 B
C++
35 lines
891 B
C++
#include "lib/self_test.h"
|
|
|
|
#include "ps/XML/Xeromyces.h"
|
|
#include "lib/res/file/vfs.h"
|
|
#include "lib/res/file/path.h"
|
|
#include "lib/res/file/trace.h"
|
|
#include "lib/res/h_mgr.h"
|
|
|
|
class TestXeromyces : public CxxTest::TestSuite
|
|
{
|
|
public:
|
|
void test_paths()
|
|
{
|
|
TS_ASSERT_OK(file_init());
|
|
TS_ASSERT_OK(file_set_root_dir(0, "../data"));
|
|
vfs_init();
|
|
|
|
TS_ASSERT_OK(vfs_mount("", "mods/_test.xero", VFS_MOUNT_RECURSIVE));
|
|
TS_ASSERT_OK(vfs_set_write_target("mods/_test.xero"));
|
|
|
|
char xmbPath[PATH_MAX];
|
|
|
|
CXeromyces::GetXMBPath("test1.xml", "test1.xmb", xmbPath);
|
|
TS_ASSERT_STR_EQUALS(xmbPath, "cache/mods/_test.xero/xmb/test1.xmb");
|
|
|
|
CXeromyces::GetXMBPath("a/b/test1.xml", "a/b/test1.xmb", xmbPath);
|
|
TS_ASSERT_STR_EQUALS(xmbPath, "cache/mods/_test.xero/xmb/a/b/test1.xmb");
|
|
|
|
vfs_shutdown();
|
|
h_mgr_shutdown();
|
|
path_reset_root_dir();
|
|
TS_ASSERT_OK(file_shutdown());
|
|
}
|
|
};
|