我试图弄清楚如何将 Trompeloeil 库与 C++11 一起使用。在这个例子中,我遇到了大量的构建错误,我不明白为什么。
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include <rapidcheck.h>
#include <rapidcheck/state.h>
#include <trompeloeil.hpp>
#include "../../../include/Orion.h"
#include "../../../include/optionCheckerFileHandler.h"
class mock{
public:
MAKE_MOCK1(getFileParams, int(int));
};
TEST_CASE( "Factorials are computed", "[factorial]" ) {
using trompeloeil::_; // wild card for matching any value
using trompeloeil::gt; // greater-than match
mock m;{
REQUIRE_CALL_V(m, getFileParams(1)).RETURN(0);
}
}
有大量的构建错误,但对我来说突出的错误如下:
In file included from /home/adny/tortoiseSoftworks/software/gamedev/tortoiseGamedev/test/testing/src/main.cpp:5:0:
/home/adny/tortoiseSoftworks/software/gamedev/tortoiseGamedev/test/testing/src/main.cpp: In function ‘void ____C_A_T_C_H____T_E_S_T____0()’:
/home/adny/tortoiseSoftworks/software/gamedev/tortoiseGamedev/test/testing/lib/trompeloeil/include/trompeloeil.hpp:4727:3: error: ‘class std::unique_ptr<trompeloeil::expectation>’ has no member named ‘handle_return’
handle_return(
也
/home/adny/tortoiseSoftworks/software/gamedev/tortoiseGamedev/test/testing/lib/trompeloeil/include/trompeloeil.hpp:3891:7: error: static assertion failed: RETURN missing for non-void function
static_assert(valid_return_type, "RETURN missing for non-void function");
如果有人可以帮助我理解这些,将不胜感激。我可以根据要求提供完整的构建错误