Fixed translator version test

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6804 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matthew Wilber 2004-02-29 18:06:47 +00:00
parent fb3053bc25
commit 4380aa029e
2 changed files with 9 additions and 6 deletions

View File

@ -115,7 +115,8 @@ CompareTranslationFormat(const translation_format *pleft,
void
TestBTranslator(BTestCase *ptest, BTranslator *ptran,
const translation_format *pExpectedIns, uint32 nExpectedIns,
const translation_format *pExpectedOuts, uint32 nExpectedOuts)
const translation_format *pExpectedOuts, uint32 nExpectedOuts,
int32 expectedVer)
{
const uint32 knmatches = 50;
uint8 matches[knmatches];
@ -169,8 +170,8 @@ TestBTranslator(BTestCase *ptest, BTranslator *ptran,
// (when ver == 100, that means that version is 1.00)
ptest->NextSubTest();
int32 ver = ptran->TranslatorVersion();
CPPUNIT_ASSERT((ver / 100) > 0);
printf(" {%d} ", (int) ver);
CPPUNIT_ASSERT(ver == expectedVer);
printf(" {0x%.8lx} ", ver);
// Input formats?
ptest->NextSubTest();
@ -236,7 +237,8 @@ TestBTranslator(BTestCase *ptest, BTranslator *ptran,
void
TranslatorLoadAddOnTest(const char *path, BTestCase *ptest,
const translation_format *pExpectedIns, uint32 nExpectedIns,
const translation_format *pExpectedOuts, uint32 nExpectedOuts)
const translation_format *pExpectedOuts, uint32 nExpectedOuts,
int32 expectedVer)
{
// Make sure the add_on loads
ptest->NextSubTest();
@ -265,7 +267,7 @@ TranslatorLoadAddOnTest(const char *path, BTestCase *ptest,
// Run a number of tests on the BTranslator object
TestBTranslator(ptest, ptran, pExpectedIns, nExpectedIns,
pExpectedOuts, nExpectedOuts);
pExpectedOuts, nExpectedOuts, expectedVer);
// NOTE: this function Release()s ptran
ptran = NULL;

View File

@ -17,6 +17,7 @@ void CheckTranslatorInfo(translator_info *pti,
void TranslatorLoadAddOnTest(const char *path, BTestCase *ptest,
const translation_format *pExpectedIns, uint32 nExpectedIns,
const translation_format *pExpectedOuts, uint32 nExpectedOuts);
const translation_format *pExpectedOuts, uint32 nExpectedOuts,
int32 expectedVer);
#endif // #ifndef TRANSLATOR_TEST_ADD_ON_H