From 4380aa029e4d3696c1195842a00bf97e42f7fdf2 Mon Sep 17 00:00:00 2001 From: Matthew Wilber Date: Sun, 29 Feb 2004 18:06:47 +0000 Subject: [PATCH] Fixed translator version test git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6804 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../add-ons/translators/TranslatorTestAddOn.cpp | 12 +++++++----- src/tests/add-ons/translators/TranslatorTestAddOn.h | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/tests/add-ons/translators/TranslatorTestAddOn.cpp b/src/tests/add-ons/translators/TranslatorTestAddOn.cpp index 8be3879f90..80c6c72350 100644 --- a/src/tests/add-ons/translators/TranslatorTestAddOn.cpp +++ b/src/tests/add-ons/translators/TranslatorTestAddOn.cpp @@ -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; diff --git a/src/tests/add-ons/translators/TranslatorTestAddOn.h b/src/tests/add-ons/translators/TranslatorTestAddOn.h index 4ee8fba73c..205805444c 100644 --- a/src/tests/add-ons/translators/TranslatorTestAddOn.h +++ b/src/tests/add-ons/translators/TranslatorTestAddOn.h @@ -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