added GetConfigurationMessage test and removed an entry for a test file that doesn't exist

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3340 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matthew Wilber
2003-05-26 14:38:27 +00:00
parent 21871f384e
commit fd6e40cd0e
2 changed files with 37 additions and 2 deletions
@@ -34,6 +34,10 @@ STXTTranslatorTest::Suite()
new TC("STXTTranslator TranslateTest",
&STXTTranslatorTest::TranslateTest));
suite->addTest(
new TC("STXTTranslator ConfigMessageTest",
&STXTTranslatorTest::ConfigMessageTest));
#if !TEST_R5
suite->addTest(
new TC("STXTTranslator LoadAddOnTest",
@@ -182,7 +186,6 @@ STXTTranslatorTest::IdentifyTest()
"../src/tests/kits/translation/data/text/sentence.stxt",
"../src/tests/kits/translation/data/text/symbols.stxt",
"../src/tests/kits/translation/data/text/zero_length.stxt",
"../src/tests/kits/translation/data/text/zero_length_styl.stxt"
};
IdentifyTests(this, proster, aPlainFiles,
sizeof(aPlainFiles) / sizeof(const char *), true);
@@ -367,6 +370,37 @@ STXTTranslatorTest::TranslateTest()
sizeof(aStyledTextFiles) / sizeof(const char *), false);
}
// Make certain that the STXTTranslator does not
// provide a configuration message
void
STXTTranslatorTest::ConfigMessageTest()
{
// Init
NextSubTest();
status_t result = B_ERROR;
BTranslatorRoster *proster = new BTranslatorRoster();
CPPUNIT_ASSERT(proster);
CPPUNIT_ASSERT(proster->AddTranslators(
"/boot/home/config/add-ons/Translators/STXTTranslator") == B_OK);
// GetAllTranslators
NextSubTest();
translator_id tid, *pids = NULL;
int32 count = 0;
CPPUNIT_ASSERT(proster->GetAllTranslators(&pids, &count) == B_OK);
CPPUNIT_ASSERT(pids);
CPPUNIT_ASSERT(count == 1);
tid = pids[0];
delete[] pids;
pids = NULL;
// GetConfigurationMessage
NextSubTest();
BMessage msg;
CPPUNIT_ASSERT(proster->GetConfigurationMessage(tid, &msg) == B_ERROR);
CPPUNIT_ASSERT(msg.IsEmpty());
}
#if !TEST_R5
// The input formats that this translator is supposed to support
@@ -29,6 +29,7 @@ public:
#endif
void IdentifyTest();
void TranslateTest();
void ConfigMessageTest();
};
#endif // STXT_TRANSLATOR_TEST_H