|
Boost Users : |
From: Ewgenij Sokolovski (ewgenijkkg_at_[hidden])
Date: 2007-06-28 06:22:40
> 1. Please provide a complete example
#include<iostream>
#include<vector>
#include <boost/test/unit_test.hpp>
#include <boost/test/parameterized_test.hpp>
using std::vector;
using std::string;
using namespace boost::unit_test;
void myTestCase(vector<string> arguments)
{
string a = arguments[0];
}
test_suite* init_unit_test_suite(int argc, char** argv)
{
throw "blub";
vector< vector<string> > arguments(1);
arguments[0].push_back("haha");
test_suite* test = BOOST_TEST_SUITE("TestSuite");
test->add(BOOST_PARAM_TEST_CASE(&myTestCase,arguments.begin(),
arguments.end()));
return test;
}
In this version I get the message:
Boost.Test internal framework error: unknown reason
But if I insert the throw "blub" into myTestCase-Function instead:
#include<iostream>
#include<vector>
#include <boost/test/unit_test.hpp>
#include <boost/test/parameterized_test.hpp>
using std::vector;
using std::string;
using namespace boost::unit_test;
void myTestCase(vector<string> arguments)
{
string a = arguments[0];
throw "blub";
}
test_suite* init_unit_test_suite(int argc, char** argv)
{
vector< vector<string> > arguments(1);
arguments[0].push_back("haha");
test_suite* test = BOOST_TEST_SUITE("TestSuite");
test->add(BOOST_PARAM_TEST_CASE(&myTestCase,arguments.begin(),
arguments.end()));
return test;
}
Then the message after executing is:
Running 1 test case...
unknown location(0): fatal error in "myTestCase": C string: blub
*** errors detected in test suite "TestSuite"; see standard output for details
So why it doesn't work, if throw is included in the main function? And why it is not possible to determine the location of the exception (the line number) when I include it into myTestCase?
> 2. What version of boost r u using?
Version 1.33.1
Best regards
Ewgenij Sokolovski
-- GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS. Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
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