Changeset View
Changeset View
Standalone View
Standalone View
source/ps/XML/tests/test_XeroXMB.h
/* Copyright (C) 2015 Wildfire Games. | /* Copyright (C) 2018 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 15 Lines | |||||
class TestXeroXMB : public CxxTest::TestSuite | class TestXeroXMB : public CxxTest::TestSuite | ||||
{ | { | ||||
private: | private: | ||||
shared_ptr<u8> m_Buffer; | shared_ptr<u8> m_Buffer; | ||||
XMBFile parse(const char* doc) | XMBFile parse(const char* doc) | ||||
{ | { | ||||
xmlDocPtr xmlDoc = xmlReadMemory(doc, int(strlen(doc)), "", NULL, | xmlDocPtr xmlDoc = xmlReadMemory(doc, int(strlen(doc)), "", nullptr, | ||||
XML_PARSE_NONET|XML_PARSE_NOCDATA); | XML_PARSE_NONET|XML_PARSE_NOCDATA); | ||||
WriteBuffer buffer; | WriteBuffer buffer; | ||||
PSRETURN ret = CXeromyces::CreateXMB(xmlDoc, buffer); | PSRETURN ret = CXeromyces::CreateXMB(xmlDoc, buffer); | ||||
xmlFreeDoc(xmlDoc); | xmlFreeDoc(xmlDoc); | ||||
TS_ASSERT_EQUALS(ret, PSRETURN_OK); | TS_ASSERT_EQUALS(ret, PSRETURN_OK); | ||||
XMBFile xmb; | XMBFile xmb; | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator