Unit-tests for localised-variant strings.
This commit is contained in:
parent
63edff078f
commit
835ae941ce
@ -341,6 +341,10 @@ bool Dir::create(mode_t mode)
|
||||
|
||||
bool Dir::removeChildren() const
|
||||
{
|
||||
if (!exists()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ok;
|
||||
PathList cs = children(NO_DOT_OR_DOTDOT | INCLUDE_HIDDEN | TYPE_FILE | TYPE_DIR);
|
||||
BOOST_FOREACH(SGPath path, cs) {
|
||||
|
@ -178,6 +178,16 @@ int parseTest()
|
||||
unsigned int skisVariant = p2->indexOfVariant("c172p-skis");
|
||||
VERIFY(skisVariant > 0);
|
||||
|
||||
|
||||
COMPARE(p2->getLocalisedProp("description", skisVariant), "A plane with skis");
|
||||
COMPARE(p2->getLocalisedProp("author", skisVariant), "Standard author");
|
||||
|
||||
unsigned int floatsVariant = p2->indexOfVariant("c172p-floats");
|
||||
VERIFY(floatsVariant > 0);
|
||||
|
||||
COMPARE(p2->getLocalisedProp("description", floatsVariant), "A plane with floats");
|
||||
COMPARE(p2->getLocalisedProp("author", floatsVariant), "Floats variant author");
|
||||
|
||||
pkg::Package::ThumbnailVec thumbs2 = p2->thumbnailsForVariant(skisVariant);
|
||||
COMPARE(thumbs2.size(), 2);
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
<description>A plane made by Cessna</description>
|
||||
<revision type="int">42</revision>
|
||||
<file-size-bytes type="int">860</file-size-bytes>
|
||||
<author>Standard author</author>
|
||||
|
||||
<tag>cessna</tag>
|
||||
<tag>ga</tag>
|
||||
@ -73,6 +74,8 @@
|
||||
<variant>
|
||||
<id>c172p-floats</id>
|
||||
<name>C172 with floats</name>
|
||||
<description>A plane with floats</description>
|
||||
<author>Floats variant author</author>
|
||||
|
||||
<thumbnail>
|
||||
<type>exterior</type>
|
||||
@ -90,6 +93,7 @@
|
||||
<variant>
|
||||
<id>c172p-skis</id>
|
||||
<name>C172 with skis</name>
|
||||
<description>A plane with skis</description>
|
||||
|
||||
<thumbnail>
|
||||
<type>exterior</type>
|
||||
|
Loading…
Reference in New Issue
Block a user