More tests, for float and double this time.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2965 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// MessageDoubleItemTest.h
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifndef MESSAGEDOUBLEITEMTEST_H
|
||||
#define MESSAGEDOUBLEITEMTEST_H
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
#include "MessageItemTest.h"
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
|
||||
typedef TMessageItemFuncPolicy
|
||||
<
|
||||
double,
|
||||
&BMessage::AddDouble,
|
||||
&BMessage::FindDouble,
|
||||
&BMessage::FindDouble,
|
||||
&BMessage::HasDouble,
|
||||
&BMessage::ReplaceDouble
|
||||
>
|
||||
TDoubleFuncPolicy;
|
||||
|
||||
struct TDoubleInitPolicy : public ArrayTypeBase<double>
|
||||
{
|
||||
inline static double Zero() { return 0; }
|
||||
inline static double Test1() { return 1.234; }
|
||||
inline static double Test2() { return 5.678; }
|
||||
inline static ArrayType Array()
|
||||
{
|
||||
ArrayType array;
|
||||
array.push_back(1.23);
|
||||
array.push_back(4.56);
|
||||
array.push_back(7.89);
|
||||
return array;
|
||||
}
|
||||
};
|
||||
|
||||
struct TInt8AssertPolicy
|
||||
{
|
||||
inline static double Zero() { return 0; }
|
||||
inline static double Invalid() { return 0;}
|
||||
};
|
||||
|
||||
typedef TMessageItemTest
|
||||
<
|
||||
double,
|
||||
B_DOUBLE_TYPE,
|
||||
TDoubleFuncPolicy,
|
||||
TDoubleInitPolicy,
|
||||
TDoubleAssertPolicy
|
||||
>
|
||||
TMessageDoubleItemTest;
|
||||
|
||||
#endif // MESSAGEDOUBLEITEMTEST_H
|
||||
|
||||
/*
|
||||
* $Log $
|
||||
*
|
||||
* $Id $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// MessageFloatItemTest.h
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifndef MESSAGEFLOATITEMTEST_H
|
||||
#define MESSAGEFLOATITEMTEST_H
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
#include "MessageItemTest.h"
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
|
||||
typedef TMessageItemFuncPolicy
|
||||
<
|
||||
float,
|
||||
&BMessage::AddFloat,
|
||||
&BMessage::FindFloat,
|
||||
&BMessage::FindFloat,
|
||||
&BMessage::HasFloat,
|
||||
&BMessage::ReplaceFloat
|
||||
>
|
||||
TFloatFuncPolicy;
|
||||
|
||||
struct TFloatInitPolicy : public ArrayTypeBase<float>
|
||||
{
|
||||
inline static float Zero() { return 0; }
|
||||
inline static float Test1() { return 1.234; }
|
||||
inline static float Test2() { return 5.678; }
|
||||
inline static ArrayType Array()
|
||||
{
|
||||
ArrayType array;
|
||||
array.push_back(1.23);
|
||||
array.push_back(4.56);
|
||||
array.push_back(7.89);
|
||||
return array;
|
||||
}
|
||||
};
|
||||
|
||||
struct TInt8AssertPolicy
|
||||
{
|
||||
inline static float Zero() { return 0; }
|
||||
inline static float Invalid() { return 0;}
|
||||
};
|
||||
|
||||
typedef TMessageItemTest
|
||||
<
|
||||
float,
|
||||
B_FLOAT_TYPE,
|
||||
TFloatFuncPolicy,
|
||||
TFloatInitPolicy,
|
||||
TFloatAssertPolicy
|
||||
>
|
||||
TMessageFloatItemTest;
|
||||
|
||||
|
||||
#endif // MESSAGEFLOATITEMTEST_H
|
||||
|
||||
/*
|
||||
* $Log $
|
||||
*
|
||||
* $Id $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "MessageConstructTest.h"
|
||||
#include "MessageOpAssignTest.h"
|
||||
#include "MessageBoolItemTest.h"
|
||||
#include "MessageFloatItemTest.h"
|
||||
#include "MessageDoubleItemTest.h"
|
||||
#include "MessageInt8ItemTest.h"
|
||||
#include "MessageInt16ItemTest.h"
|
||||
#include "MessageInt32ItemTest.h"
|
||||
@@ -19,6 +21,8 @@ Test* MessageTestSuite()
|
||||
tests->addTest(TMessageConstructTest::Suite());
|
||||
tests->addTest(TMessageOpAssignTest::Suite());
|
||||
tests->addTest(TMessageBoolItemTest::Suite());
|
||||
tests->addTest(TMessageFloatItemTest::Suite());
|
||||
tests->addTest(TMessageDoubleItemTest::Suite());
|
||||
tests->addTest(TMessageInt8ItemTest::Suite());
|
||||
tests->addTest(TMessageInt16ItemTest::Suite());
|
||||
tests->addTest(TMessageInt32ItemTest::Suite());
|
||||
|
||||
Reference in New Issue
Block a user