borromeotlhs / amop Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/amop
Automatically exported from code.google.com/p/amop
What steps will reproduce the problem?
1. running scons in sources directory with g++ (gcc version 4.3.2)
2.
3.
What is the expected output? What do you see instead?
when running scons command, the amop library should be construct, but there
is a compilation error with the 'wall' and 'pedantic' options.
What version of the product are you using? On what operating system?
amop 0.31.3, OS debian lenny/sid, Linux crater 2.6.24-1-amd64 #1 SMP Mon
Feb 11 13:47:43 UTC 2008 x86_64 GNU/Linux
Please provide any additional information below.
patch is enclosed.
Original issue reported on code.google.com by [email protected]
on 25 Sep 2008 at 12:02
Attachments:
std::auto_ptr needs <memory> header.
Here is the fix:
Index: MockFunctionImpl.h
===================================================================
--- MockFunctionImpl.h (revision 135)
+++ MockFunctionImpl.h (working copy)
@@ -6,6 +6,7 @@
#include "Comparable.h"
#include <vector>
#include <map>
+#include <memory>
namespace amop
{
Original issue reported on code.google.com by [email protected]
on 21 Nov 2008 at 6:45
It's not a bug, but why not write the makefile as:
INCPATH=../../UnitTest++/src
LIBPATH=-L./ -L../../UnitTest++/
It may make build test of amop easier, I think. By default, it expects
UnitTest++ in current directory, it's a little strange.
What steps will reproduce the problem?
1. on Linux, build amop test with: make test
What is the expected output? What do you see instead?
It will fail as UnitTest++ does not exist in current directory.
What version of the product are you using? On what operating system?
v0.30.1,v0.31.3
Please provide any additional information below.
No.
Original issue reported on code.google.com by [email protected]
on 16 Dec 2008 at 10:33
What steps will reproduce the problem?
1. Get the source code from SVN r139
2. Compiler using VC2005 SP1 x64 32bit cross compiler
3. Compile error
What is the expected output? What do you see instead?
Compile successful and run test no problem
What version of the product are you using? On what operating system?
r139, XP sp2, VC2005 sp1, 32bit x64 cross compiler
Please provide any additional information below.
It compiles successfully against amop-0.31.3
The error message is:
f:\foo_project\3rd_party\amop\amop\include\Functor.h(49) : error C2953:
'amop::detail::Functor<R(__cdecl C::* )(void)>' : class template has
already been defined
f:\foo_project\3rd_party\amop\amop\include\Functor.h(22) : see
declaration of 'amop::detail::Functor<R(__cdecl C::* )(void)>'
f:\foo_project\3rd_party\amop\amop\include\Functor.h(58) : error C2953:
'amop::detail::Functor<R(__cdecl C::* )(void) const>' : class template has
already been defined
f:\foo_project\3rd_party\amop\amop\include\Functor.h(32) : see
declaration of 'amop::detail::Functor<R(__cdecl C::* )(void) const>'
f:\foo_project\3rd_party\amop\amop\include\Functor.h(98) : error C2953:
'amop::detail::Functor<R(__cdecl C::* )(T1)>' : class template has already
been defined
f:\foo_project\3rd_party\amop\amop\include\Functor.h(83) : see
declaration of 'amop::detail::Functor<R(__cdecl C::* )(T1)>'
f:\foo_project\3rd_party\amop\amop\include\Functor.h(98) : error C2953:
'amop::detail::Functor<R(__cdecl C::* )(T1) const>' : class template has
already been defined
f:\foo_project\3rd_party\amop\amop\include\Functor.h(83) : see
declaration of 'amop::detail::Functor<R(__cdecl C::* )(T1) const>'
f:\foo_project\3rd_party\amop\amop\include\Functor.h(99) : error C2953:
'amop::detail::Functor<R(__cdecl C::* )(T1,T2)>' : class template has
already been defined
f:\foo_project\3rd_party\amop\amop\include\Functor.h(84) : see
declaration of 'amop::detail::Functor<R(__cdecl C::* )(T1,T2)>'
f:\foo_project\3rd_party\amop\amop\include\Functor.h(99) : error C2953:
'amop::detail::Functor<R(__cdecl C::* )(T1,T2) const>' : class template has
already been defined
f:\foo_project\3rd_party\amop\amop\include\Functor.h(84) : see
declaration of 'amop::detail::Functor<R(__cdecl C::* )(T1,T2) const>'
f:\foo_project\3rd_party\amop\amop\include\Functor.h(100) : error C2953:
'amop::detail::Functor<R(__cdecl C::* )(T1,T2,T3)>' : class template has
already been defined
f:\foo_project\3rd_party\amop\amop\include\Functor.h(85) : see
declaration of 'amop::detail::Functor<R(__cdecl C::* )(T1,T2,T3)>'
f:\foo_project\3rd_party\amop\amop\include\Functor.h(100) : error C2953:
'amop::detail::Functor<R(__cdecl C::* )(T1,T2,T3) const>' : class template
has already been defined
f:\foo_project\3rd_party\amop\amop\include\Functor.h(85) : see
declaration of 'amop::detail::Functor<R(__cdecl C::* )(T1,T2,T3) const>'
f:\foo_project\3rd_party\amop\amop\include\Functor.h(101) : error C2953:
'amop::detail::Functor<R(__cdecl C::* )(T1,T2,T3,T4)>' : class template has
already been defined
f:\foo_project\3rd_party\amop\amop\include\Functor.h(86) : see
declaration of 'amop::detail::Functor<R(__cdecl C::* )(T1,T2,T3,T4)>'
.........
Original issue reported on code.google.com by [email protected]
on 24 Dec 2008 at 7:28
We are compiling with GCC under FreeBSD without TR1. I had to modify the
code at some places to not use TR1 (the __GNUC__ precompiler switch doesn't
help here).
It would be good to have a precompiler switch to enable/disable TR1 usage.
And in one place in ReturnMatchBuild.h std::tr1::shared_ptr should be
replaced by AmopSharedPtr.
Original issue reported on code.google.com by [email protected]
on 27 Oct 2008 at 10:42
What steps will reproduce the problem?
1. compile the attached example
2. run the example
What is the expected output? What do you see instead?
expect: the test should fail
instead: the test passes !!!
What version of the product are you using? On what operating system?
SVN rev 135
Please provide any additional information below.
I have attached the files I have used for testing. The unit-test I've used
is CxxTest.
Original issue reported on code.google.com by [email protected]
on 22 Nov 2008 at 6:19
Attachments:
When compiling with VS2005 I get the following warning:
c:\cde\cde\sw\amop\include\mockobjectbase.h(82) : warning C6386: Buffer
overrun: accessing 'mVirtualTable->mVtable', the writable size is '200'
bytes, but '204' bytes might be written: Lines: 81, 82
c:\cde\cde\sw\amop\include\MockObjectBase.h(93) : see reference to
function template instantiation 'amop::TReturnMatchBuilder<F>
amop::Detail::TMockObjectBase::CreateMatchBuilder<F>(size_t,amop::Detail::TFunct
ionAddress)'
being compiled
with
[
F=Load0
]
C:\cde\cde\sw\Amop\include\MockObject.h(30) : see reference to
functiontemplate instantiation 'amop::TReturnMatchBuilder<F>
amop::Detail::TMockObjectBase::CreateMatchBuilder<F,T>(F)' being compiled
with
[
F=Load0,
T=IEntityCache
]
TC_LSHAnswerEncryption.cpp(53) : see reference to function template
instantiation 'amop::TReturnMatchBuilder<F>
amop::TMockObject<T>::Method<Load0>(F)'being compiled
with
[
F=Load0,
T=IEntityCache
]
Original issue reported on code.google.com by [email protected]
on 23 Oct 2008 at 12:51
What steps will reproduce the problem?
1. compile a test with -Wall
What is the expected output? What do you see instead?
expected: no warnings
instead:
.../include/amop/ReturnMatchBuilder.h:355: warning: ‘amop::detail::Empty
amop::ignore()’ defined but not used
.../include/amop/Destructor.h:29: warning: ‘amop::detail::Destructor
amop::destructor()’ defined but not used
What version of the product are you using? On what operating system?
SVN rev 135
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 22 Nov 2008 at 6:23
What steps will reproduce the problem?
1. The problem comes from diamond inheritance but can be reproduced with
the following unit test :
class IBaseInterface
{
public:
virtual int SimpleFunctionWithReturn() = 0;
};
class IInterface : public virtual IBaseInterface
{
public:
// ...
};
TEST(MockObjectMethodSimpleWithReturn)
{
TMockObject<IInterface> mock;
mock.Method(&IInterface::SimpleFunctionWithReturn)
.Will(22);
CHECK_EQUAL(22, ((IInterface*)mock)->SimpleFunctionWithReturn());
}
=> It will failed
What is the expected output?
To get a correct behaviour, I need to remove the virtual inheritance (not
what I want) or to change the IInterface declaration to (without changing
IBaseInterface of course)
class IInterface : public virtual IBaseInterface
{
public:
virtual int SimpleFunctionWithReturn() = 0;
};
What's wrong with this inheritance ?
What I don't understand ?
What version of the product are you using? On what operating system?
I'm using gcc 3.4.6 20060404 (Red Hat 3.4.6-3)
Thank you for this great mock framework
Original issue reported on code.google.com by [email protected]
on 27 Jun 2008 at 1:10
What steps will reproduce the problem?
1. Run any test using MockObject.call() in valgrind
2.
3.
What is the expected output? What do you see instead?
I expect no errors from valgrind. But I see:
==11062== Conditional jump or move depends on uninitialised value(s)
==11062== at 0x80F72BD:
amop::detail::MockObjectBase::createMockFunction(amop::detail::DynamicFunction*)
==11062== by 0x80BDDBF: amop::detail::ReturnMatchBuilder<double
(StubFunction::*)(unsigned), amop::detail::CallPolicy>
amop::MockObject<StubFunction, amop::AutoVerify>::call<double
(StubFunction::*)(unsigned)>(double (StubFunction::*)(unsigned))
(MockObject.h:261)
What version of the product are you using? On what operating system?
Please provide any additional information below.
The reason is that amop::detail::DynamicFunction::m_handler is not initialized.
Add to the constructor:
DynamicFunction::DynamicFunction() : m_handler(NULL)
{
}
Original issue reported on code.google.com by [email protected]
on 10 Jan 2010 at 12:33
What steps will reproduce the problem?
1. compile some mock test with -Wall
2. get some warnings like:
warning: declaration of "redirector" shadows a member of 'this'
warning: declaration of "expect" shadows a member of 'this'
What is the expected output? What do you see instead?
No warnings.
What version of the product are you using? On what operating system?
SVN revision 135
Please provide any additional information below.
I have provided a dumb solution. Not sure if it's a good one :D
Original issue reported on code.google.com by [email protected]
on 22 Nov 2008 at 6:11
Attachments:
What steps will reproduce the problem?
1. Running with WIN32 compiler conditional define
2.
3.
What is the expected output? What do you see instead?
The AMOP library should be construct, but there is a compilation error:
"E2021: array must have at least one element" in Config.h, line 84, inside
HorribleCast.
What version of the product are you using? On what operating system?
AMOP 0.31.3 on WinXP.
Please provide any additional information below.
There is a comment inside HorribleCast function: "Cause a compile-time
error if in, out and u are not the same size. If the compile fails here, it
means the compiler has peculiar unions which would prevent the cast from
working.". So, this is a clue about what is going on.
Original issue reported on code.google.com by [email protected]
on 12 Jan 2009 at 10:50
What steps will reproduce the problem?
1. configure with ccmake -DCMAKE_INSTALL_PREFIX=/foo/bar
2. make install
What is the expected output? What do you see instead?
expected: install headers and libAmop.a under /foo/bar
actual: no install target
What version of the product are you using? On what operating system?
SVN rev 135
Please provide any additional information below.
I've attached a diff that adds support for this.
The headers will be installed under CMAKE_INSTALL_PREFIX/include/amop and
the lib under CMAKE_INSTALL_PREFIX/lib.
Also, made some changes in the CMakeLists.txt not really neaded:
- nested ADD_SUBDIRECTORY()
These changes are recomended:
- CMAKE_MINIMUM_REQUIRED() is need only once, in the top dir
These changes are highly recommended :D
- replaced ../include and ../../include with ${CMAKE_SOURCE_DIR}/include
From what I understand 2.4 is quite old and buggy compared with the newer
2.6. I am using 2.6 and would recommend you upgrade, too ;-)
Original issue reported on code.google.com by [email protected]
on 22 Nov 2008 at 8:41
Attachments:
What steps will reproduce the problem?
mock.Method( void f*::() ).Throws(exception);
What is the expected output? What do you see instead?
does not throw on void function
What version of the product are you using? On what operating system?
0.31.3 on Windows 7 x64, VS2010
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 31 May 2011 at 9:12
What steps will reproduce the problem?
1. Try to compile static_cast<std::string&>(MockObject<std::string>())
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Add operator T& to MockObject<T>:
operator T&()
{
return *((T*)getVptr());
}
Original issue reported on code.google.com by [email protected]
on 30 Dec 2009 at 3:37
What steps will reproduce the problem?
1. mock.Method().Throw( exception )
What is the expected output? What do you see instead?
it throws a bad any cast instead of exception
What version of the product are you using? On what operating system?
0.31.3 on Windows 7 x64
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 31 May 2011 at 9:06
Having pkg-config support would be nice.
I have attached an example of such an amop.pc file that I've made by hand,
so that I can use amop from a local dir. (It should be possible to let
cmake create this file with the correct paths from an amop.pc.in template).
Original issue reported on code.google.com by [email protected]
on 21 Nov 2008 at 8:35
Attachments:
What steps will reproduce the problem?
1. Change a unit test so it fails
2. running the runTest binary with failing tests still return 0.
What is the expected output? What do you see instead?
I expect that the runTest should return a value different from 0
when a unit test fails.
What version of the product are you using? On what operating system?
0.31.3 on a Fedora Linux
Please provide any additional information below.
It seems like you might want to add 'return' in your Test/Main.cpp file.
Original issue reported on code.google.com by [email protected]
on 20 Nov 2008 at 8:11
What steps will reproduce the problem?
1. Create copy constructor or a function returning a TMockObject.
2. Use that mock.
Example:
TMockObject<IInterface> CreateInterfaceMock()
{
TMockObject<IInterface> mock;
return mock;
}
TEST
{
TMockObject<IInterface> mock = CreateInterfaceMock();
// Do something with that mock, it'll fail badly.
}
What version of the product are you using? On what operating system?
Latest stable 0.30.1 crash, latest dev 0.31.3 seem to freeze (inf loop).
Original issue reported on code.google.com by [email protected]
on 11 Nov 2008 at 2:06
What steps will reproduce the problem?
1. Run amop tests in vs2008 sp1
2.
3.
What is the expected output? What do you see instead?
expected: All tests pass.
actual:
.\TestMockObject.cpp(145): error: Failure in MockObjectMethodSimpleExpect:
Unhandled exception: Crash!
.\TestMockObject.cpp(173): error: Failure in
MockObjectMethodMultipleExpect: Unhandled exception: Crash!
.\TestMockObject.cpp(214): error: Failure in
MockObjectMethodSimpleExpectAndReturn: Unhandled exception in
CHECK_EQUAL(2,
((IInterface*)mock)->SimpleFunctionWithParamsAndReturn(21.0f, "Hello
World", "SomeText"))
.\TestMockObject.cpp(365): error: Failure in MockObjectMethodVerifyExpects:
Unhandled exception: Crash!
FAILURE: 4 out of 26 tests failed (4 failures).
What version of the product are you using? On what operating system?
amop-0.30.1
Windows XP
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 21 Sep 2009 at 2:25
Throwing an exception from mock function
Usage:
e.g. mockFile.Method(&File::Close).Throws(FileCloseException("message"));
Original issue reported on code.google.com by [email protected]
on 7 Apr 2008 at 8:34
I guess very few people will want to pollute their /usr/include or
/usr/local/include with a bunch of headers and would prefer to keep them
under a directory - the question is what should be the name of this dir and
Amop gives no hint on this.
It would be nicer to give such a hint to your users by moving the headers
under include/amop, for example.
This will make decisions simpler for the user, as it will be clear that the
headers are to be installed under /usr/include/amop or
/usr/local/include/amop (so no more guessing if it should be
/usr/include/amop, /usr/include/Amop or something else).
This is important for linux where files names are case sensitive ;-)
Even better, you could add an install target to the CMakeLists.txt (I'm a
new user of cmake myself and, unfortunately, I have no idea at this time on
how to implement such install target).
Original issue reported on code.google.com by [email protected]
on 21 Nov 2008 at 6:55
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.