The code is compiling fine in VS2015 but in VS2019 code is throwing errors for CPPUNIT. Is it not supported in C++17 std? if not how to resolve these error:
Code:
class CAbcTestCase : public CppUnit::TestCase
{
CPPUNIT_TEST_SUITE(CAbcTestCase);
CPPUNIT_TEST(AbcThruRMB);
CPPUNIT_TEST(AbcMultiThruRMB);
CPPUNIT_TEST(AbcFolderThruRMB);
CPPUNIT_TEST(AbcUseFileThruRMB);
........
........
//CPPUNIT_TEST(Abc_UpdateRegistry);
CPPUNIT_TEST(Abc_Initialize);
**CPPUNIT_TEST_SUITE_END();** // *This line has all the below mentioned errors*
}
CPPUNIT error:
Error C2039 'auto_ptr': is not a member of 'std'
Error C2065 'auto_ptr': undeclared identifier.
Error C2660 'CHistoryTestCase::suite': function does not take 1 arguments
Error C2275 'CppUnit:: TestSuite': illegal use of this type as an expression
Error (active) E0135 namespace "std" has no member "auto_ptr"
std::auto_ptr
: it was deprecated in C++11, and was removed in C++17.auto_ptr
, not the CPPUNIT macro directly.auto_ptr
was deprecated and finally removed, replaced byunique_ptr
. I suspect you're using a very old version of pcpunit, or your macros need updating