TEST_F (MamaPriceTestC, testSetWithHintsMamaPrice)
{

   double x = 100;

   mama_price_hints_t hint1 = MAMA_PRICE_IMPL_HINT_PREC_10, 
                      hint2 = MAMA_PRICE_IMPL_HINT_PREC_2;

   mamaPrice price     = CreateTestPrice(x,hint1),
             nullPrice = NULL;

   EXPECT_EQ ( MAMA_STATUS_INVALID_ARG, mamaPrice_setWithHints(nullPrice, x, hint2) );
   EXPECT_EQ ( MAMA_STATUS_OK, mamaPrice_setWithHints(price, x, hint2) );

   EXPECT_EQ ( MAMA_STATUS_OK, mamaPrice_destroy(price) );
}
Exemple #2
0
mama_status avisValue_getPrice(const Value* pValue, mamaPrice result)
{
    if (!pValue) return MAMA_STATUS_NULL_ARG;
    if (pValue->type != TYPE_REAL64)
          return MAMA_STATUS_WRONG_FIELD_TYPE;

    mamaPrice_setWithHints (result, pValue->value.real64, MAMA_PRICE_HINTS_NONE);
    return MAMA_STATUS_NOT_IMPLEMENTED;
}