More test cases for reading shops

This commit is contained in:
2015-07-07 22:22:10 -04:00
parent 93f9860624
commit 59f60710c5
7 changed files with 337 additions and 1 deletions

View File

@@ -510,6 +510,7 @@ static void readShopFromXml(ticpp::Element& data, cShop& shop) {
entry->GetValue(&type);
if(entries_found >= 30)
throw xBadNode(type, entry->Row(), entry->Column(), fname);
entries_found++;
if(type == "item") {
int amount, num, chance = 100;
std::string title, descr;
@@ -550,7 +551,7 @@ static void readShopFromXml(ticpp::Element& data, cShop& shop) {
attr->GetText(&title, false);
} else if(name == "description") {
attr->GetText(&descr, false);
} else throw xBadAttr(type, name, attr->Row(), attr->Column(), fname);
} else throw xBadNode(name, attr->Row(), attr->Column(), fname);
}
if(!reqs.empty())
throw xMissingElem("special", *reqs.begin(), entry->Row(), entry->Column(), fname);