[Mockpp-commits] mockpp/mockpp VisitableMockObject.h,1.34,1.35 VisitableMockObject_macro.h,1.25,1.26
Brought to you by:
ewald-arnold
|
From: Ewald A. <ewa...@us...> - 2005-02-27 18:04:38
|
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4304/mockpp Modified Files: VisitableMockObject.h VisitableMockObject_macro.h VisitableMockObject_template.h Log Message: VisitableMockObjects also take constraints as controlling elements Index: VisitableMockObject_template.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockObject_template.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** VisitableMockObject_template.h 27 Feb 2005 11:48:15 -0000 1.22 --- VisitableMockObject_template.h 27 Feb 2005 18:04:29 -0000 1.23 *************** *** 32,35 **** --- 32,37 ---- #define MOCKPP_VISITABLEMOCKOBJECT_TEMPLATE_H + #include <mockpp/constraint/ConstraintHolder.h> + #include <mockpp/constraint/IsEqual.h> namespace mockpp { *************** *** 66,70 **** std::vector<unsigned>::const_iterator end = counter.end(); [...973 lines suppressed...] *** 997,1005 **** for (unsigned i = 0; i < this->t1vec.size(); ++i) if ( this->counter[i] > 0 ! && t1 == this->t1vec[i] ! && t2 == this->t2vec[i] ! && t3 == this->t3vec[i] ! && t4 == this->t4vec[i] ! && t5 == this->t5vec[i]) { if (this->tvec.at(i) != 0) --- 1352,1360 ---- for (unsigned i = 0; i < this->t1vec.size(); ++i) if ( this->counter[i] > 0 ! && this->t1vec[i]->eval(t1) ! && this->t2vec[i]->eval(t2) ! && this->t3vec[i]->eval(t3) ! && this->t4vec[i]->eval(t4) ! && this->t5vec[i]->eval(t5)) { if (this->tvec.at(i) != 0) Index: VisitableMockObject.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockObject.h,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** VisitableMockObject.h 27 Feb 2005 11:48:14 -0000 1.34 --- VisitableMockObject.h 27 Feb 2005 18:04:28 -0000 1.35 *************** *** 346,350 **** const your_type4 &p4, const your_type5 &p5, unsigned count = std::numeric_limits < unsigned >::max ()); ! #endif // DOXYGEN_SHOULD_SKIP_THIS --- 346,350 ---- const your_type4 &p4, const your_type5 &p5, unsigned count = std::numeric_limits < unsigned >::max ()); ! // @todo update doc #endif // DOXYGEN_SHOULD_SKIP_THIS Index: VisitableMockObject_macro.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockObject_macro.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** VisitableMockObject_macro.h 27 Feb 2005 11:48:14 -0000 1.25 --- VisitableMockObject_macro.h 27 Feb 2005 18:04:28 -0000 1.26 *************** *** 285,288 **** --- 285,294 ---- MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ objptr->methname ## ResponseValues.add(rv, (type1&)p1, count); \ + } \ + \ + void addResponseValue(const ret_type &rv, const mockpp::ConstraintHolder<type1> &p1, unsigned count = MOCKPP_UNLIMITED) \ + { \ + MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ + objptr->methname ## ResponseValues.add(rv, p1, count); \ } *************** *** 292,295 **** --- 298,308 ---- MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ objptr->methname ## ResponseValues.add(rv, (type1&)p1, (type2&)p2, count); \ + } \ + \ + void addResponseValue(const ret_type &rv, const mockpp::ConstraintHolder<type1> &p1, \ + const mockpp::ConstraintHolder<type2> &p2, unsigned count = MOCKPP_UNLIMITED) \ + { \ + MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ + objptr->methname ## ResponseValues.add(rv, p1, p2, count); \ } *************** *** 299,302 **** --- 312,323 ---- MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ objptr->methname ## ResponseValues.add(rv, (type1&)p1, (type2&)p2, (type3&)p3, count); \ + } \ + \ + void addResponseValue(const ret_type &rv, const mockpp::ConstraintHolder<type1> &p1, \ + const mockpp::ConstraintHolder<type2> &p2, \ + const mockpp::ConstraintHolder<type3> &p3, unsigned count = MOCKPP_UNLIMITED) \ + { \ + MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ + objptr->methname ## ResponseValues.add(rv, p1, p2, p3, count); \ } *************** *** 306,309 **** --- 327,339 ---- MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ objptr->methname ## ResponseValues.add(rv, (type1 &)p1, (type2 &)p2, (type3 &)p3, (type4 &)p4, count); \ + } \ + \ + void addResponseValue(const ret_type &rv, const mockpp::ConstraintHolder<type1> &p1, \ + const mockpp::ConstraintHolder<type2> &p2, \ + const mockpp::ConstraintHolder<type3> &p3, \ + const mockpp::ConstraintHolder<type4> &p4, unsigned count = MOCKPP_UNLIMITED) \ + { \ + MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ + objptr->methname ## ResponseValues.add(rv, p1, p2, p3, p4, count); \ } *************** *** 313,316 **** --- 343,356 ---- MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ objptr->methname ## ResponseValues.add(rv, (type1)p1, (type2)p2, (type3)p3, (type4)p4, (type5)p5, count); \ + } \ + \ + void addResponseValue(const ret_type &rv, const mockpp::ConstraintHolder<type1> &p1, \ + const mockpp::ConstraintHolder<type2> &p2, \ + const mockpp::ConstraintHolder<type3> &p3, \ + const mockpp::ConstraintHolder<type4> &p4, \ + const mockpp::ConstraintHolder<type5> &p5, unsigned count = MOCKPP_UNLIMITED) \ + { \ + MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ + objptr->methname ## ResponseValues.add(rv, p1, p2, p3, p4, p5, count); \ } *************** *** 324,327 **** --- 364,373 ---- MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ objptr->methname ## ResponseValues.add(t, (type1&)p1, count); \ + } \ + \ + void addResponseThrowable(mockpp::Throwable *t, const mockpp::ConstraintHolder<type1> &p1, unsigned count = MOCKPP_UNLIMITED) \ + { \ + MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ + objptr->methname ## ResponseValues.add(t, p1, count); \ } *************** *** 331,334 **** --- 377,387 ---- MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ objptr->methname ## ResponseValues.add(t, (type1&)p1, (type2&)p2, count); \ + } \ + \ + void addResponseThrowable(mockpp::Throwable *t, const mockpp::ConstraintHolder<type1> &p1, \ + const mockpp::ConstraintHolder<type2> &p2, unsigned count = MOCKPP_UNLIMITED) \ + { \ + MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ + objptr->methname ## ResponseValues.add(t, p1, p2, count); \ } *************** *** 338,341 **** --- 391,402 ---- MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ objptr->methname ## ResponseValues.add(t, (type1 &)p1, (type2&)p2, (type3&)p3, count); \ + } \ + \ + void addResponseThrowable(mockpp::Throwable *t, const mockpp::ConstraintHolder<type1> &p1, \ + const mockpp::ConstraintHolder<type2> &p2, \ + const mockpp::ConstraintHolder<type3> &p3, unsigned count = MOCKPP_UNLIMITED) \ + { \ + MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ + objptr->methname ## ResponseValues.add(t, p1, p2, p3, count); \ } *************** *** 345,348 **** --- 406,418 ---- MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ objptr->methname ## ResponseValues.add(t, (type1 &)p1, (type2 &)p2, (type3 &)p3, (type4 &)p4, count); \ + } \ + \ + void addResponseThrowable(mockpp::Throwable *t, const mockpp::ConstraintHolder<type1> &p1, \ + const mockpp::ConstraintHolder<type2> &p2, \ + const mockpp::ConstraintHolder<type3> &p3, \ + const mockpp::ConstraintHolder<type4> &p4, unsigned count = MOCKPP_UNLIMITED) \ + { \ + MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ + objptr->methname ## ResponseValues.add(t, p1, p2, p3, p4, count); \ } *************** *** 352,355 **** --- 422,435 ---- MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ objptr->methname ## ResponseValues.add(t, (type1)p1, (type2)p2, (type3)p3, (type4)p4, (type5)p5, count); \ + } \ + \ + void addResponseThrowable(mockpp::Throwable *t, const mockpp::ConstraintHolder<type1> &p1, \ + const mockpp::ConstraintHolder<type2> &p2, \ + const mockpp::ConstraintHolder<type3> &p3, \ + const mockpp::ConstraintHolder<type4> &p4, \ + const mockpp::ConstraintHolder<type5> &p5, unsigned count = MOCKPP_UNLIMITED) \ + { \ + MOCKPP_ASSERT_FALSE(objptr->isActivated()); \ + objptr->methname ## ResponseValues.add(t, p1, p2, p3, p4, p5, count); \ } *************** *** 664,667 **** --- 744,748 ---- void m_name (const mockpp::ConstraintHolder<v_type1> ¶m1) \ { \ + addExpectedMethod(std::string(#m_name)); \ mockpp::Constraint<v_type1>::AP cons1 (param1); \ m_name ## Parameter1.addExpected(cons1.release()); \ *************** *** 717,720 **** --- 798,802 ---- const mockpp::ConstraintHolder<v_type2> ¶m2) \ { \ + addExpectedMethod(std::string(#m_name)); \ mockpp::Constraint<v_type1>::AP cons1 (param1); \ mockpp::Constraint<v_type2>::AP cons2 (param2); \ *************** *** 778,781 **** --- 860,864 ---- const mockpp::ConstraintHolder<v_type3> ¶m3) \ { \ + addExpectedMethod(std::string(#m_name)); \ mockpp::Constraint<v_type1>::AP cons1 (param1); \ mockpp::Constraint<v_type2>::AP cons2 (param2); \ *************** *** 821,825 **** else \ { \ ! addActualMethod(func_name); \ try { \ mockpp::Throwable *t; \ --- 904,908 ---- else \ { \ ! addActualMethod(func_name); \ try { \ mockpp::Throwable *t; \ *************** *** 847,850 **** --- 930,934 ---- const mockpp::ConstraintHolder<v_type4> ¶m4) \ { \ + addExpectedMethod(std::string(#m_name)); \ mockpp::Constraint<v_type1>::AP cons1 (param1); \ mockpp::Constraint<v_type2>::AP cons2 (param2); \ *************** *** 924,927 **** --- 1008,1012 ---- const mockpp::ConstraintHolder<v_type5> ¶m5) \ { \ + addExpectedMethod(std::string(#m_name)); \ mockpp::Constraint<v_type1>::AP cons1 (param1); \ mockpp::Constraint<v_type2>::AP cons2 (param2); \ *************** *** 1027,1030 **** --- 1112,1116 ---- m_ret_type m_name(const mockpp::ConstraintHolder<v_type1> ¶m1) \ { \ + addExpectedMethod(std::string(#m_name)); \ mockpp::Constraint<v_type1>::AP cons1 (param1); \ m_name ## Parameter1.addExpected(cons1.release()); \ *************** *** 1093,1096 **** --- 1179,1183 ---- const mockpp::ConstraintHolder<v_type2> ¶m2) \ { \ + addExpectedMethod(std::string(#m_name)); \ mockpp::Constraint<v_type1>::AP cons1 (param1); \ mockpp::Constraint<v_type2>::AP cons2 (param2); \ *************** *** 1167,1170 **** --- 1254,1258 ---- const mockpp::ConstraintHolder<v_type3> ¶m3) \ { \ + addExpectedMethod(std::string(#m_name)); \ mockpp::Constraint<v_type1>::AP cons1 (param1); \ mockpp::Constraint<v_type2>::AP cons2 (param2); \ *************** *** 1248,1251 **** --- 1336,1340 ---- const mockpp::ConstraintHolder<v_type4> ¶m4) \ { \ + addExpectedMethod(std::string(#m_name)); \ mockpp::Constraint<v_type1>::AP cons1 (param1); \ mockpp::Constraint<v_type2>::AP cons2 (param2); \ *************** *** 1337,1340 **** --- 1426,1430 ---- const mockpp::ConstraintHolder<v_type5> ¶m5) \ { \ + addExpectedMethod(std::string(#m_name)); \ mockpp::Constraint<v_type1>::AP cons1 (param1); \ mockpp::Constraint<v_type2>::AP cons2 (param2); \ |