
"Ted Byers" <r.ted.byers@gmail.com> writes:
On 21/05/12 04:50, Ted Byers wrote:
Here is the full output from my program:
$ ./decision.test.suite
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct NULL not valid
Aborted (core dumped)
Now, all the code in this program is focussed on number crunching, so none of it involves strings. I am guessing that I missed something in setting up a test suite.
Actually, I found the culprit. I had assumed initially that all I'd needed was defined in a single header:
#include <boost/test/unit_test.hpp>
But, I continued investigating after I posted here, and observed that in the framework example it also had:
#include <boost/test/included/unit_test.hpp>
I added that to my file, and it still compiled, but what a difference at run time. The program now runs to completion without an exception. What I don't have in an explanation, or why I haven't found, yet, documentation that says what headers are needed in what test scenarios.
If memory serves me right, #include <boost/test/included/unit_test.hpp> pulls in the full code of the library. If you only #include <boost/test/unit_test.hpp> you need to link against the precompiled Boost.Test library. See http://www.boost.org/doc/libs/1_49_0/libs/test/doc/html/utf/user-guide/usage... for details. Hope this helps, -- Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- AVASYS CORPORATION FSF Associate Member #1962 Help support software freedom http://www.fsf.org/jf?referrer=1962