Ignore:
Timestamp:
Jun 23, 2010, 12:02:30 AM (12 years ago)
Author:
Peter
Message:

adding functor f_gxy and f_gx (similar to f_gx_hy) and adding some tests for all three classes above.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/utility_test.cc

    r2273 r2274  
    6363void test_less_nan(test::Suite& suite);
    6464void test_ptr_compare(test::Suite& suite);
     65void test_compose_functors(test::Suite& suite);
    6566
    6667int main(int argc, char* argv[])
     
    175176  test_load2(suite);
    176177
     178  test_compose_functors(suite);
     179
    177180  return suite.return_value();
    178181}
     
    200203  suite.add(false);
    201204}
     205
     206
     207void test_compose_functors(test::Suite& suite)
     208{
     209  typedef utility::abs<double> U1;
     210  // we use float here to check conversion from float to double in functors
     211  typedef utility::Exp<float> U2;
     212  typedef std::plus<double> B;
     213  U1 u1;
     214  U2 u2;
     215  B b;
     216
     217  utility::compose_f_gx_hy<B, U1, U2> binary =
     218    utility::make_compose_f_gx_hy(b, u1, u2);
     219
     220  utility::compose_f_gxy<U2, B> binary2 =
     221    utility::make_compose_f_gxy(u2, b);
     222
     223  utility::compose_f_gx<U1, U2> unary =
     224    utility::make_compose_f_gx(u1, u2);
     225}
     226
    202227
    203228
Note: See TracChangeset for help on using the changeset viewer.