|
Boost Users : |
From: Tim Allison (tallison_at_[hidden])
Date: 2008-02-28 11:29:30
I'm sorry, I completely missed your reply. Based on your comment that
the new docs are for 1.34, The contents of FuserTest.cc are cut and
pasted from example 1:
// each test module could contain no more then one 'main' file with init
function defined
// alternatively you could define init function yourself
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
//____________________________________________________________________________//
// most frequently you implement test cases as a free functions with
automatic registration
BOOST_AUTO_TEST_CASE( test1 )
{
// reports 'error in "test1": test 2 == 1 failed'
BOOST_CHECK( 2 == 1 );
}
//____________________________________________________________________________//
// each test file may contain any number of test cases; each test case
has to have unique name
BOOST_AUTO_TEST_CASE( test2 )
{
int i = 0;
// reports 'error in "test2": check i == 2 failed [0 != 2]'
BOOST_CHECK_EQUAL( i, 2 );
BOOST_CHECK_EQUAL( i, 0 );
}
//____________________________________________________________________________//
// EOF
The error messages are:
FuserTests.cc:9: error: expected constructor, destructor, or type
conversion before '(' token
FuserTests.cc:18: error: expected constructor, destructor, or type
conversion before '(' token
Tim Allison
>
> Today's Topics:
>
> 1. Re: A request for help using the Boost Unit Test Library
> (Gennadiy Rozental)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 21 Feb 2008 20:05:42 +0000 (UTC)
> From: Gennadiy Rozental <rogeeff_at_[hidden]>
> Subject: Re: [Boost-users] A request for help using the Boost Unit
> Test Library
> To: boost-users_at_[hidden]
> Message-ID: <loom.20080221T200258-326_at_[hidden]>
> Content-Type: text/plain; charset=utf-8
>
> Tim Allison <tallison <at> meicompany.com> writes:
>> I am using boost 1.33.1-42 <at> 586 on Suse 10.2 (If it matters, my computer
>> is a Latitude D510) and Gnu compiler 4.1.3-29 <at> 586 (as listed by Smart
>> Package Manager).
>
> The new docs cover Boost.Test starting 1.34
>
>> When I run the make file, it echos out the following line:
>> g++ -Wno-deprecated -frepo -m32 -g -I../lib -I/usr/X11R6/include
>> -I../../../source/ecs/shared -DOS_IS_LINUX -c FuserTests.cc
>>
>> FuserTests.cc is the file into which I have attempted to copy the
>> examples.
>
> Would you care to share with us the file content?
>
>> The case I am most interested in running uses BOOST_AUTO_TEST_CASE(
>> functionName ). This line produces the error:
>> FuserTests.cc:16: error: expected constructor, destructor, or type
>> conversion before ?(? token
>
> Obviosly Boost.Test headers are not included.
>
> Gennadiy
>
>
>
>
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