boost.test
을 부스트 1.33.1의 원격 시스템에서 사용하려고합니다.이전 버전의 boost.test에 문제가 발생했습니다.
#define BOOST_TEST_MODULE MyTest
#include <boost/test/included/unit_test.hpp> // I've changed here
int add(int i, int j) { return i+j; }
BOOST_AUTO_TEST_CASE(my_test) // <--- line 7
{
// seven ways to detect and report the same error:
BOOST_CHECK(add(2,2) == 4); // #1 continues on error
BOOST_REQUIRE(add(2,2) == 4); // #2 throws on error
if(add(2,2) != 4)
BOOST_ERROR("Ouch..."); // #3 continues on error
if(add(2,2) != 4)
BOOST_FAIL("Ouch..."); // #4 throws on error
if(add(2,2) != 4) throw "Ouch..."; // #5 throws on error
BOOST_CHECK_MESSAGE(add(2,2) == 4, // #6 continues on error
"add(..) result: " << add(2,2));
BOOST_CHECK_EQUAL(add(2,2), 4); // #7 continues on error
}
을하지만 원격 시스템의 파일 unit_test.hpp
가 존재하지 않습니다 : 내 PC에 http://www.boost.org/doc/libs/1_42_0/libs/test/doc/html/tutorials/hello-the-testing-world.html에서이 작은 예를 작동합니다. 내 컴퓨터에서 파일 unit_test_framework.hpp
은 간단히 :
// deprecated
#include <boost/test/included/unit_test.hpp>
이며 주 시스템에 있습니다. 그래서가 포함 변경 시도 :
#include <boost/test/included/unit_test_framework.hpp>
하지만 컴파일러는 말한다 :
main.cpp:7: error: expected constructor, destructor, or type conversion before ‘(’ token
이 무엇입니까? 그것을 해결하는 방법?
어떤 시스템에서 포함? –
원격 시스템에 어떤 버전의 부스트가 설치되어 있는지 알려주십시오. – jopasserat
remote : 1.33.1, local : 1.36.0 –