Boost logo

Boost Users :

Subject: Re: [Boost-users] [test] Crash when running my unit tests
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2009-04-30 11:57:16


On Thu, Apr 30, 2009 at 5:32 PM, Christian Henning <chhenning_at_[hidden]>wrote:

> To avoid name collisions I use namespaces for each
> format. Each of those namespaces contain tests with the same name,
> like this:
>
> bmp_test.cpp:
> namespace bmp_test {
> BOOST_AUTO_TEST_CASE( read_image_test ) {}
> }
>
> png_test.cpp:
> namespace png_test {
> BOOST_AUTO_TEST_CASE( read_image_test ) {}
> }
>
> I hope such use case is fine with boost::test.
>
> Regards,
> Christian
>

Christian,

to avoid name collisions use anonymous namespaces if you don't really
require the names outside the compilation unit:

namespace
{
   BOOST_AUTO_TEST_CASE(read_image_test){}
}

This will ensure internal linkage for the names.

My other other suggestion would be trying to disable as many TC's as
possible in the problematic CPP to see what's going wrong there. If you
debug in MSVC, you can switch on VS to break into the code as soon as some
violation happens. This way you will be able to break into global
initialization as well.

Regards,
Ovanes



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