Boost logo

Boost Users :

From: Ranji Raghavan (ranji.raghavan_at_[hidden])
Date: 2007-02-09 12:15:45


-----Original Message-----
From: Ranji Raghavan [mailto:ranji.raghavan_at_[hidden]]
Sent: Friday, February 09, 2007 11:09 AM
To: ''boost-users_at_[hidden]'
Subject: FW: [Boost-users] Question about Boost.Test

I am rookie as far as BOOST.TEST is concerned - I am trying to compile and
link a simple BOOST.TEST program using VS 2005 (SEE EMAIL BELOW FOR STEPS).
When I try and this simple plagiarized test program listed below, I get a
bunch of LINKER errors -

Error 1 error LNK2019: unresolved external symbol "void __cdecl
boost::test_tools::tt_detail::check_impl(class
boost::test_tools::predicate_result const &,class
boost::basic_wrap_stringstream<char> &,class
boost::unit_test::basic_cstring<char const >,unsigned int,enum
boost::test_tools::tt_detail::tool_level,enum
boost::test_tools::tt_detail::check_type,unsigned int,...)"
(?check_impl_at_tt_detail_at_test_tools_at_boost@@YAXABVpredicate_result_at_23@AAV?$basi
c_wrap_stringstream_at_D@3_at_V?$basic_cstring@$$CBD_at_unit_test_at_3@IW4tool_level_at_123
@W4check_type_at_123@IZZ) referenced in function "void __cdecl
free_test_function(void)" (?free_test_function@@YAXXZ) NewTest.obj

Error 2 error LNK2019: unresolved external symbol "public: void
__thiscall boost::unit_test::test_suite::add(class
boost::unit_test::test_unit *,unsigned long,unsigned int)"
(?add_at_test_suite_at_unit_test_at_boost@@QAEXPAVtest_unit_at_23@KI_at_Z) referenced in
function "class boost::unit_test::test_suite * __cdecl
init_unit_test_suite(int,char * * const)"
(?init_unit_test_suite@@YAPAVtest_suite_at_unit_test_at_boost@@HQAPAD_at_Z)
NewTest.obj

Etc etc ... May be I am missing something trivial that is causing this
problem.

Appreciate any help rendered....

Ranji

-----Original Message-----
From: Ranji Raghavan [mailto:ranji.raghavan_at_[hidden]]
Sent: Thursday, February 08, 2007 9:51 PM
To: 'boost-users_at_[hidden]'
Subject: RE: [Boost-users] Question about Boost.Test

I have downloaded and built the BOOST libraries using VS2005 - I have
pointed the VC++ directories INCLUDE files to the BOOST install directory
and the Library files to the folder where the BOOST libraries were built to.
But when I try even the simplest of test programs from one of the examples
you had written - see below

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

// most frequently you implement test cases as a free functions
void free_test_function()
{
    // reports 'error in "free_test_function": test 2 == 1 failed'
    BOOST_CHECK(2 == 1); // non-critical test => continue after failure
}

test_suite* init_unit_test_suite( int, char**) {
    test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" );

    // this example will pass cause we know ahead of time number of expected
failures
    test->add( BOOST_TEST_CASE( &free_test_function ), 1 /* expected one
error */ );

    return test;
}

I receive LINK errors - any suggestions ?

-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Gennadiy Rozental
Sent: Wednesday, February 07, 2007 4:09 PM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] Question about Boost.Test

"Ranji Raghavan" <ranji.raghavan_at_[hidden]> wrote in message
news:000a01c74a28$df145f30$e90a0a0a_at_openspirit.com...
> Actually, I am just looking into BOOST reading the documentation etc
> Do you recommend any particular version of BOOST that I should install and
> play with?

I recommend you to use the latest version. Try 1.34 RC.

> I am looking to define all the test data in XML files - maybe
> 1000's of them - have a class that parses this XML file (some tests have
> about 7-8 pieces of disparate primitive data types string, double, int
> etc)and pass the array of class instances to a test method for repetitive
> testing. If this is not pragmatic, could you recommend another way?

Use BOOST_PARAM_TEST_CASE. It works differently in latest version then
before. You will have less problems with parametrs object lifetime
management.
Let me know if you have any problems.

Gennadiy

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net