mockpp-devel Mailing List for Mock Objects for C++
Brought to you by:
ewald-arnold
You can subscribe to this list here.
2003 |
Jan
(1) |
Feb
(1) |
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
(2) |
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ewald A. <mo...@ew...> - 2008-05-04 11:21:55
|
Hello, > it seems I hit a bug in mockpp. :-( seems you're right :-) but I am not sure how to handle the issue. The original cause lies rather within OutBound and not within ConstraintList. Changing the behaviour of ContraintList as you proposed might introduce other problems in existing sources so I am thinking about implementing an alternative way to handle verify() in the end. greets -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de |
From: BUCHMULLER N. <no...@ni...> - 2008-05-02 19:04:05
|
Hi, it seems I hit a bug in mockpp. :-( The problem is that if I use an OutBound constraint in a VisitableMockObject, then I cannot use verify() on the object. The attached test program (vm.cpp) will fail, complaining that the return list of the OutBound object is empty: mendel@vger:~$ ./vm terminate called after throwing an instance of 'mockpp::AssertionFailedError' what(): foo/parameter1 added constraint[0] does not match: <returns []> != 0 Aborted (core dumped) I tried to investigate the problem, and I found that ConstraintList::checkImmediateValue() is called _two_ times on each constraint. The first call is performed in addActual() - unless constraint checking is deferred until verify() call - and the second call in verify(). It seems to me as erroneous, since the first call pops the outbound value from the list, so the second call will surely fail. (This does not matter for the 'normal' constraints - they can be eval()'d many times -, that's why it went unnoticed till now.) I created a patch (attached as mockpp-1.16.4-OutBound_verify_fix.diff) that worked for me, but unfortunately I was not able to compile the unit tests (and so I was unable to check if it does not break something else). Can you please check if my reasoning is right, and check if the patch is correct? Best regards, norbi |
From: Ewald A. <ew...@ew...> - 2007-10-03 00:38:37
|
Hello, > Undefined symbols: > "vtable for std::basic_ostringstream<char, std::char_traits<char>, > std::allocator<char> >", referenced from: > __ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE > $non_lazy_ptr in main.o > "operator delete(void*)", referenced from: > yylex() in scanner.o > yylex() in scanner.o > yylex() in scanner.o I tried to reproduce the problem but everything works for me. I still assume, there is some unintended difference in the two invocations. Could you check in the lines before the error message if there is libstdc++ included, similar to this: -ldl -lstdc++ And please send me more of the output before the error message. greets -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de icq:227435282 |
From: Daniel E. <eg...@ma...> - 2007-10-01 01:02:39
|
I need to cross compile mockpp, but I'm having trouble. I'm trying to compile with ./configure --host=i686-apple-darwin9 make clean make but I get Undefined symbols: "vtable for std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >", referenced from: __ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE $non_lazy_ptr in main.o "operator delete(void*)", referenced from: yylex() in scanner.o yylex() in scanner.o yylex() in scanner.o Things work fine, when I use ./configure make clean make This is strange, because the platform I'm on is % uname -mprs Darwin 9.0.0b5 i386 i386 Is there anything more I should pass to configure? /Daniel |
From: Ewald A. <ew...@ew...> - 2006-09-03 12:23:27
|
- new ReturnObjectListStub is handy when you want to return a list of objects and onConsecutiveCalls is not appropriate - OutBound and TriggeredOutbound take iterators to add input data =2D-=20 Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de icq:227435282 |
From: Ewald A. <mo...@ew...> - 2006-08-16 11:32:40
|
- new constraint TriggeredOutbound together with TriggerStub and ReturnAndTriggerStub provide the use of outbound values based on another incoming method parameter - some fixes to ministl due to warnings with g++ 4.x - cleanup documentation (api + handbook) =2D-=20 Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de icq:227435282 |
From: Ewald A. <mo...@ew...> - 2006-07-31 08:15:56
|
Hello, > // the fucntion return user obj whose indendifier = id > int find( int id, User & usr); > } > > i have no way to mock 'find' method with Chainable Mock Object, like, > > find_chainer.expect(once).with(eq......). if I got it right you need to return a value by reference based on another parameter to the same method: id=1 ==> usr="one" id=2 ==> usr="two" Currently this is not possible (besides of using a handcrafted method and some ReturnObjectList's :-) There is a class Outbound which could return the value. But it returns one after the other, similar to ReturnObjectList. And the decision which expectation matches and which object to return is based on all parameters. So a potential solution might be to devise a class TriggerOutbound which somehow fills in the data when the method is actually invoked (after the parameters have been evaluated). Unfortunately all of the objects are completely independent of each others. So there must be some kind of bridge to the actual variable. So the solution could look like this: Reference<User> *reference= new Reference<User>(); find_chainer.expect(once()) .with(eq(1), reference) .will(returnValue(true)) .will(triggerOutBound(reference)) I will think about this a bit more. Maybe I can find a nice solution :-) greets -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de icq:227435282 |
From: Ewald A. <ew...@ew...> - 2006-06-09 18:11:12
|
Hello, unfortunately I have no perfect solution. You always need some way to switch between production and test. That's probably what you have to pay for testability in C++. From my experience you have quite a lot of "unneeded" virtuals in the end. Everything else tends to become a bit tricky and more verbose. What is you actual problem? Performance is usually none and security in the meaning of preventing to override the method is not safe. Another solution I can offer is to turn B into a template. Instantiate one for production using A and one for testing using mock_A. There might as well be some other way of redirection. For example create a wrapper template for A/mock_A which helps you to select the correct one: template <class A_type> class A_wrapper { A_type *a; A_wrapper (A_type *an_a) : a(an_a) {} void test() { a->A_type::test(); } }; Maybe a compiler switch is acceptable which includes a "virtual" while compiling debug code: #ifdef DEBUG #define DEBUG_VIRTUAL virtual #else #define DEBUG_VIRTUAL #endif hope that helps a bit :-) > Hi, > > I have the following code : > > class A { > public: > void test() > { > // do some stuff > } > } > > class A_mock : public A, public MOCKPP_NS::MockObject > { > public: > A_mock() : ex("counter", 0){}; > > void test( > ec.inc(); > ); > > ExpectationCounter ex; > } > > class B > { > public : > A* m_A; > void f1() > { > m_A->test(); > } > } > > int main () > { > A_mock* mock = new A_mock(); > mock->ex.setExpected(1); > > > B varB; > varB.m_A = mock; > > mock->verify(); > } > > > > Since the test function in the base class A is NOT virtual, polymorphism > don't work. To work, I have to declarw A::test virtual. My problem, > is that in my design that function (A::test) should not be a virtual one. > I find it akward to declare it virtual only for testing. Any hint on > doing that kind of test with mockpp? I don't want to modify the B class. > > Thank you and great work on mockpp > > Patrick -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de icq:227435282 |
From: Patrick F. <pat...@gm...> - 2006-06-08 20:06:52
|
Hi, I have the following code : class A { public: void test() { // do some stuff } } class A_mock : public A, public MOCKPP_NS::MockObject { public: A_mock() : ex("counter", 0){}; void test( ec.inc(); ); ExpectationCounter ex; } class B { public : A* m_A; void f1() { m_A->test(); } } int main () { A_mock* mock = new A_mock(); mock->ex.setExpected(1); B varB; varB.m_A = mock; mock->verify(); } Since the test function in the base class A is NOT virtual, polymorphism don't work. To work, I have to declarw A::test virtual. My problem, is that in my design that function (A::test) should not be a virtual one. I find it akward to declare it virtual only for testing. Any hint on doing that kind of test with mockpp? I don't want to modify the B class. Thank you and great work on mockpp Patrick |
From: Ewald A. <mo...@ew...> - 2006-03-06 19:44:07
|
-- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de icq:227435282 |
From: Carle <Car...@US...> - 2006-02-26 16:12:29
|
Hi, Here's a small contribution to Mockpp that creates a "mockpp-config" scri= pt to help dealing with configure detection of Mockpp when used in other projec= t (install path & required includes and libs). Since I'm not an expert in those kind of scripts, feel free to mod= ify anything to fit Mockpp more specific needs. Patch file have been created with latest cvs development tree (Feb 26 200= 6). The two files must be copied in the root directory. Patch can be applied by d= oing the following command in root directory : patch -p1 < diffMockpp.patch Afterward, configure needs to be regenerated. If possible, I would appreciate if this patch could be merged to the curr= ent cvs development tree. Thanks for Mockpp, it is very useful :-) Carle --=20 Carle Cote (http://pages.infinit.net/cotc2204/) Laborius - Universit=E9 de Sherbrooke (http://www.gel.usherb.ca/laborius/= ) MARIE's project homepage (http://marie.sf.net) |
From: Ewald A. <ew...@ew...> - 2006-02-04 12:04:31
|
Hello Jean-Pierre, >d:/dve/tools/mockpp/mockpp-1.11.1/mockpp/examples/mock_greeter.cpp:339: >undefined reference to `CxxTest::Link::active() const' > > >I don't know how to find the method CxxTest::Link::active(). >IS it in CPPunit ? (installed on my machine) > > > I just verified with cygwin. I had the strange problem that the wrapper executable did not compile due to missing prototypes for strlen and the like. But after tweaking libtool by adding "#include <string.h>" everything compiled and ran flawlessly. Mingw and cygwin share the same basis, so this is a bit puzzeling for me. I will try to install and verify with mingw environment. In the meanwhile I suggest to run run-configure-ascii.sh to setup the files. This is what I always do. You could also add CXXTEST_EXPORT to the sources to enforce exporting the symbols. I am not experienced in mingw but windows platforms need exported symbols whereas Linux does not. I have no idea what happens in mixed environments. All I can say is, BCB5 and MSVC are working. There is also a script bug-report.sh which could tell me more about your problems. Try running it. greets |
From: Ewald A. <ew...@ew...> - 2006-01-16 17:05:22
|
Hello, > Recently I have to use mockpp-1.11.1 on sun studio 10. In company with > Emil, my colleague, we build it successfully after revising a few source. > We have upload the patches to sourceforge and any comment is welcome. thanks for the patches. The two patches for the counted stuff were useless, as these files are generated. And there are 12 places which needed changes. Maybe the patches were only intended to show the problem. But anyway, I changed the generator scripts. There is now a switch for sun to select the needed code. Most compilers insist on the additional "template". #ifdef __SUN__ #define MOCKPP_NO_TEMPLATE_HINT #endif Can I send you a tarball to verify the build on sun before I upload a new distribution? greets -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de icq:227435282 |
From: Linzhi h. <op...@ho...> - 2006-01-16 03:33:12
|
Hi! Recently I have to use mockpp-1.11.1 on sun studio 10. In company with Emil, my colleague, we build it successfully after revising a few source. We have upload the patches to sourceforge and any comment is welcome. Best Regards Kylix Huang _________________________________________________________________ 免费下载 MSN Explorer: http://explorer.msn.com/lccn |
From: Ewald A. <mo...@ew...> - 2005-05-21 14:39:35
|
Hello Vincent, > The compiler runs out of memory while trying to compile > InvocationMocker.h. Probably I had a similar problem with gcc 2.95. I don't remember which file it was but I stopped compilation after quite a while. There seems to be an optimization problem. When I used -O1 it worked fine. So I suggest to add -O1 to your CXXFLAGS or add a single statement for the cpp file which breaks. Is there a special reason why you use a rather old compiler? gcc 2.95 compiles the complete lib most of the time, but sometimes it crashes for no obvious reason. mockpp uses templates a lot so you should use a rather up-to-date compiler. greets -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de icq:227435282 -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de icq:227435282 -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de icq:227435282 |
From: Ewald A. <ew...@ew...> - 2005-05-06 22:09:22
|
A new section in the handbook about optimizing production code for testing= =20 purposes has been started. There is also a sample implementation on how to= =20 handle time dependencies. 2005-05-06 1.8.0: - included missing project file for bcb5 - fix for msvc7.1 - cleanup ThrowableList - basic support for "Design By Contract" - time server classes - extended handbook =2D-=20 Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de icq:227435282 |
From: Ewald A. <mo...@ew...> - 2005-03-02 13:21:49
|
Hello, > I tried to compile mockpp 1.4.0 on Linux with gcc 2.9.5. I am impressed that gcc 2.95 even works somehow ;-) I don't remember when I tried last but as far as I rember it crashed due to am internal error. The usage of the templates needs a really capable and up-to-date compiler ;-) None of the MS compilers I know of does it right. > > TrackingCounter.cpp:165: `::find' undeclared (first use here) > I think you forgot to include <algorithm> for find. did you add the #include and did it work then? If you really got 1.2.x working there is nothing against it. Obviously there is some hidden compiler dependency. I will include the line and release 1.5.0 the next days with some enhancements for VisitableMockObjects. greets -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot des icq:227435282 |
From: Ewald A. <mo...@ew...> - 2005-01-30 20:39:37
|
Fixed all known bugs and issues in the sources. Documentation cleanup. See ChangeLog for details. -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de icq:227435282 |
From: Ewald A. <mo...@ew...> - 2004-09-11 15:28:45
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, Currently there is a port of jMock in the works. This will offer another MockObject approach which removes several limitations with the current implementation. Download from cvs if you are interested. See http://jmock.org/getting-started.html for an introduction into the java original. - -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de icq:227435282 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iD8DBQFBQxlRC5JDB2jxrzQRAmlTAJ47KULjgxMqgz+o+b++jTW8ZxTuowCgrh2p MgQDI7u8gPrio59AtBnADkA= =uQQi -----END PGP SIGNATURE----- |
From: <ben...@id...> - 2004-05-21 08:13:29
|
Dear Open Source developer I am doing a research project on "Fun and Software Development" in which I kindly invite you to participate. You will find the online survey under http://fasd.ethz.ch/qsf/. The questionnaire consists of 53 questions and you will need about 15 minutes to complete it. With the FASD project (Fun and Software Development) we want to define the motivational significance of fun when software developers decide to engage in Open Source projects. What is special about our research project is that a similar survey is planned with software developers in commercial firms. This procedure allows the immediate comparison between the involved individuals and the conditions of production of these two development models. Thus we hope to obtain substantial new insights to the phenomenon of Open Source Development. With many thanks for your participation, Benno Luthiger PS: The results of the survey will be published under http://www.isu.unizh.ch/fuehrung/blprojects/FASD/. We have set up the mailing list fa...@we... for this study. Please see http://fasd.ethz.ch/qsf/mailinglist_en.html for registration to this mailing list. _______________________________________________________________________ Benno Luthiger Swiss Federal Institute of Technology Zurich 8092 Zurich Mail: benno.luthiger(at)id.ethz.ch _______________________________________________________________________ |
From: Ewald A. <mo...@ew...> - 2003-04-13 17:56:02
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mockpp 1.1.8 is released=20 =2D - Port to OpenBsd 3.1 and g++ 2.95 =2D - fix for MSVC =2D - simplified MockObject verify() =2D - removed useless and buggy multithread stuff =2D - fixed MockObject::verify() =2D From my personal knowledge mockpp is now running on =2D - Linux (SuSE 8.2) + gcc 3.3 =2D - OpenBsd 3.1 + gcc 2.95.3 =2D - Windows (ME, NT) + Borland CBuilder 5.=20 Since OpenBSD is a working platform I assume that other *BSD flavours work fine as well. There is also a report about working MS Visual C++ though I have no project files yet. =2D --=20 Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de mobil/sms:+49-162-8001240 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iD8DBQE+maSmXyQcrD0ZXUYRAjfoAJ9tksP8Kp5/wVYBL4yjoHCCMbN92ACfWuK+ BOpf2GMJ1mUIJCH22+Q+oVc=3D =3D3b+O =2D----END PGP SIGNATURE----- |
From: Philippe F. <ph...@fr...> - 2003-03-17 13:49:42
|
Hi, Something along the lines of mockpp has been long expected. I was thinking about writing something simpler. I have a few questions: From reading the documentation, I understand that you can check on one method if it is called the right number of times with the right arguments. Is it possible to combine this for multiple methods ? For example: class A { virtual void method1( int i ); virtual void method2( int j ); }; I want to check that my code calls a.method1( 1 ); a.method2( 3 ); and I want an error if it does: a.method2( 3 ); a.method1( 1 ); The arguments are correct, the number of call is correct but the methods have been called in reverse order. Is a more integration with CppUnit planned ? It would be quite convenient to have more integration. regards, Philippe |
From: Ewald A. <mo...@ew...> - 2003-03-11 02:31:50
|
This bug fix release closes a memory leak and should now compile and run on= =20 Windoze under BCB5. =2D-=20 Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de mobil/sms:+49-162-8001240 |
From: Steve F. <ste...@m3...> - 2003-03-09 13:30:40
|
Welcome to the club, but is there a URL? Steve Ewald Arnold wrote: > The final release of mockpp is available. > > mockpp is a platform independent generic unit testing framework for C++. It's > goal is to facilitate developing unit tests in the spirit of > Mock Objects (http://www.mockobjects.com) and EasyMock > (http://www.easymock.org). > > Mockpp has no own testing framework. So CppUnit (http://cppunit.sf.net) is > recommended. > > The main development platform of mockpp is Linux. But it is intended to be > platform independent and a port to Borland BCB is already in work. > > Contributions, ports to other platforms and comments are highly welcome. > > greetings > |
From: Ewald A. <mo...@ew...> - 2003-03-08 15:28:23
|
The final release of mockpp is available. mockpp is a platform independent generic unit testing framework for C++. It= 's=20 goal is to facilitate developing unit tests in the spirit of=20 Mock Objects (http://www.mockobjects.com) and EasyMock=20 (http://www.easymock.org). Mockpp has no own testing framework. So CppUnit (http://cppunit.sf.net) is= =20 recommended. The main development platform of mockpp is Linux. But it is intended to be= =20 platform independent and a port to Borland BCB is already in work.=20 Contributions, ports to other platforms and comments are highly welcome. greetings =2D-=20 Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de mobil/sms:+49-162-8001240 |