Hello, 

I am trying to run this simple example and I run into issues, could somebody please help me understand what am I doing incorrect here. 



#include <boost/test/unit_test.hpp>
using namespace boost::unit_test;

//____________________________________________________________________________//

// you could easily implement test cases as a free functions
// this test case will need to be explecetely registered in test tree
void free_test_function()
{
    // reports 'error in "free_test_function": test 2 == 1 failed'
    BOOST_CHECK(2 == 1); // non-critical test => continue after failure

    // reports 'unknown location(0): fatal error in "free_test_function": memory access violation
    //          d:\source code\boost\libs\test\example\unit_test_example_02.cpp(25): last checkpoint'
    int* p = (int*)0x01;
    BOOST_CHECK( *p == 0 );
}

//____________________________________________________________________________//


test_suite*
init_unit_test_suite( int, char* [] ) {
    framework::master_test_suite().p_name.value = "Unit test example 02";

    // register the test case in test tree and specify number of expected failures so
    // this example will pass at runtime. We expect 2 errors: one from failed check and 
    // one from memory acces violation
    framework::master_test_suite().add( BOOST_TEST_CASE( &free_test_function ), 2 );

    return 0;
}



1>------ Build started: Project: unitTestPrac2, Configuration: Debug Win32 ------
1>Linking...
1>LINK : fatal error LNK1561: entry point must be defined
1>Build log was saved at "file://c:\Users\amaster\Desktop\AVM_Documents\CppPractise\unitTestPrac2\unitTestPrac2\Debug\BuildLog.htm"
1>unitTestPrac2 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Thank you 
Ankit 

--

From the withered tree, a flower blooms.
                                                         - Zen





--

From the withered tree, a flower blooms.
                                                         - Zen