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