don't suppress exception in mapnik::color constructor when init from a string

This commit is contained in:
Dane Springmeyer 2011-07-05 23:01:51 +00:00
parent 161d978fb4
commit c4fa04cdad
2 changed files with 10 additions and 8 deletions

View file

@ -38,14 +38,7 @@ color::color( std::string const& css_string)
blue_(0),
alpha_(0xff)
{
try
{
color_factory::init_from_string(*this,css_string);
}
catch (config_error const& err)
{
std::cerr << err.what() << std::endl;
}
}
std::string color::to_string() const

View file

@ -402,6 +402,15 @@ def test_map_pickle():
eq_(pickle.loads(pickle.dumps(m)), m)
# Color initialization
@raises(Exception) # Boost.Python.ArgumentError
def test_color_init_errors():
c = mapnik2.Color()
@raises(RuntimeError)
def test_color_init_errors():
c = mapnik2.Color('foo') # mapnik config
def test_color_init():
c = mapnik2.Color('blue')