fix #3290
This commit is contained in:
parent
15f905b272
commit
4beda3bc46
1 changed files with 6 additions and 26 deletions
|
@ -1,36 +1,16 @@
|
||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
#include <mapnik/enumeration.hpp>
|
#include <mapnik/enumeration.hpp>
|
||||||
|
#include <mapnik/symbolizer_enumerations.hpp>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
namespace mapnik {
|
|
||||||
|
|
||||||
enum _test_enumeration_enum : std::uint8_t
|
|
||||||
{
|
|
||||||
TEST_ONE,
|
|
||||||
TEST_TWO,
|
|
||||||
_test_enumeration_enum_MAX
|
|
||||||
};
|
|
||||||
|
|
||||||
DEFINE_ENUM( _test_enumeration_e, _test_enumeration_enum );
|
|
||||||
|
|
||||||
static const char * _test_enumeration_strings[] = {
|
|
||||||
"test_one",
|
|
||||||
"test_two",
|
|
||||||
""
|
|
||||||
};
|
|
||||||
|
|
||||||
IMPLEMENT_ENUM( _test_enumeration_e, _test_enumeration_strings )
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_CASE("enumeration") {
|
TEST_CASE("enumeration") {
|
||||||
|
|
||||||
mapnik::_test_enumeration_e e(mapnik::TEST_ONE);
|
mapnik::line_cap_e e(mapnik::ROUND_CAP);
|
||||||
CHECK( e.as_string() == "test_one" );
|
CHECK( e.as_string() == "round" );
|
||||||
// test the << operator, which calls `as_string` internally
|
// note: test the << operator, which calls `as_string` internally
|
||||||
// this is not used in mapnik, but kept for back compat
|
// is not used in mapnik, but kept for back compat
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
s << e;
|
s << e;
|
||||||
CHECK( s.str() == "test_one" );
|
CHECK( s.str() == "round" );
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue