chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes

Hi all,

according to

https://www.typemock.com/docs/?book=Ipp&page=custom_assertions_with_predica.htm

i am trying to us the IS<> functionality to check in an assertion, if a function was called with the expected argument. The argument is an enum. I get the following error when trying to run the test:

C++ exception with description "ERROR: Internal Error in predicate - no arg copied" thrown in the test body.

However, if I use for example a std::string type, the assertion works fine. What could be the issue concerning the enum? Thank's a lot in advance.


enum MyEnum
{
    VAL0 = 0,
    VAL1 = 1
};
 
class Person
{
public:
    void SaveAll(const MyEnum myEnum)
    {
    }
};
 
TEST_F(MyTest, AssertCall)
{   
    Person person;
    WHEN_CALLED(person.SaveAll(VAL0)).Ignore();
    person.SaveAll(VAL0);
    
    ASSERT_WAS_CALLED(person.SaveAll(IS<MyEnum>([](const MyEnum& val) {return val == VAL0;})));
asked by jccc_erp (1.1k points)

1 Answer

0 votes
Hi Julian,

Thank you for the information, we will dig into it.
I will send you a private mail for you to send me the logs of the run.
You can enable logs in our configuration tool.

Cheers,

Daniel Markov.

Support Specialist.
answered by Daniel Markov (5.8k points)
...