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:
parent
fb3053bc25
commit
4380aa029e
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user