Merge branch 'master' into spirit-x3

This commit is contained in:
artemp 2016-02-17 09:49:56 +01:00
commit 005959d81c
2 changed files with 7 additions and 27 deletions

View file

@ -52,7 +52,7 @@ matrix:
env: JOBS=8 COVERAGE=true HEAVY_JOBS=4
before_install:
- export PYTHONUSERBASE=${PYTHONUSERBASE}
- export PYTHONUSERBASE=$(pwd)/mason_packages/.link
- export PATH=${PYTHONUSERBASE}/bin:${PATH}
- export COVERAGE=${COVERAGE:-false}
- export MASON_PUBLISH=${MASON_PUBLISH:-false}

View file

@ -1,36 +1,16 @@
#include "catch.hpp"
#include <mapnik/enumeration.hpp>
#include <mapnik/symbolizer_enumerations.hpp>
#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") {
mapnik::_test_enumeration_e e(mapnik::TEST_ONE);
CHECK( e.as_string() == "test_one" );
// test the << operator, which calls `as_string` internally
// this is not used in mapnik, but kept for back compat
mapnik::line_cap_e e(mapnik::ROUND_CAP);
CHECK( e.as_string() == "round" );
// note: test the << operator, which calls `as_string` internally
// is not used in mapnik, but kept for back compat
std::stringstream s;
s << e;
CHECK( s.str() == "test_one" );
CHECK( s.str() == "round" );
}