don't suppress exception in mapnik::color constructor when init from a string
This commit is contained in:
parent
161d978fb4
commit
c4fa04cdad
2 changed files with 10 additions and 8 deletions
|
@ -38,14 +38,7 @@ color::color( std::string const& css_string)
|
||||||
blue_(0),
|
blue_(0),
|
||||||
alpha_(0xff)
|
alpha_(0xff)
|
||||||
{
|
{
|
||||||
try
|
color_factory::init_from_string(*this,css_string);
|
||||||
{
|
|
||||||
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
|
std::string color::to_string() const
|
||||||
|
|
|
@ -402,6 +402,15 @@ def test_map_pickle():
|
||||||
eq_(pickle.loads(pickle.dumps(m)), m)
|
eq_(pickle.loads(pickle.dumps(m)), m)
|
||||||
|
|
||||||
# Color initialization
|
# 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():
|
def test_color_init():
|
||||||
c = mapnik2.Color('blue')
|
c = mapnik2.Color('blue')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue