Subject: Re: [Boost-bugs] [Boost C++ Libraries] #13024: Using function as data source in BOOST_DATA_TEST_CASE initiate the conflict with static variables initialization
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-01-03 00:42:42
#13024: Using function as data source in BOOST_DATA_TEST_CASE initiate the conflict
with static variables initialization
-------------------------------+-------------------------------
Reporter: mikhail@⦠| Owner: Gennadiy Rozental
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: test
Version: Boost 1.64.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+-------------------------------
Comment (by Raffi Enficiaud):
I am not sure the crashes you are experiencing is due to a change in
Boost.Test between 1.63 and a later version. The {{{get_files}}} function
is always evaluated at static initialization time as the
{{{BOOST_DATA_TEST_CASE}}} creates a static global object.
I tend to think that there is something in filesystem that prevents from
calling functions during this global static initialization phase. So I
suggest that you ask or raise a ticket on boost.filesystem side to make it
clear.
However, there is the ticket #12953 that should help as it postpones the
evaluation of the datasets, it would be good if you can give a try.
To support this further, I suggest getting the files later in the init
phase by providing a proper dataset interface to the function retrieving
the files, as shown
[http://www.boost.org/doc/libs/1_66_0/libs/test/doc/html/boost_test/tests_organization/test_cases/test_case_generation/datasets.html#boost_test.tests_organization.test_cases.test_case_generation.datasets.example_descr
here] (for instance getting the files when calling {{{begin}}} or
{{{size}}}).
Please keep me posted.
-- Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13024#comment:5> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2018-01-03 00:48:56 UTC