Skip to content

Commit

Permalink
Add missing coverage of invalid palette type - refs #509
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed Sep 28, 2015
1 parent 477c259 commit 3b68a8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mapnik_palette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ NAN_METHOD(Palette::New) {
}
if (info.Length() >= 2) {
if (info[1]->IsString()) {
std::string obj = std::string(TOSTR(info[1]));
std::string obj = TOSTR(info[1]);
if (obj == "rgb")
{
type = mapnik::rgba_palette::PALETTE_RGB;
Expand Down
1 change: 1 addition & 0 deletions test/palette.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('mapnik.Palette ', function() {
assert.throws(function() { new mapnik.Palette(); });
assert.throws(function() { new mapnik.Palette(1); });
assert.throws(function() { new mapnik.Palette('foo'); });
assert.throws(function() { new mapnik.Palette(new Buffer('\xff\x00\xff\xff\xff\xff','ascii'), 'bogus') });
assert.throws(function() {
new mapnik.Palette(new Buffer('\x01\x02\x03'));
}, (/invalid palette length/));
Expand Down

0 comments on commit 3b68a8d

Please sign in to comment.