File: compilation_test.cpp

package info (click to toggle)
mapnik 2.0.0%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 35,496 kB
  • sloc: cpp: 91,793; python: 6,051; xml: 3,528; sh: 848; makefile: 70; lisp: 10
file content (36 lines) | stat: -rw-r--r-- 797 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#define BOOST_TEST_MODULE compile_test

// boost.test
#include <boost/test/included/unit_test.hpp>

// mapnik
#include <mapnik/map.hpp>
#include <mapnik/svg_renderer.hpp>

// std
#include <sstream>
#include <iterator>

/**
 * This test is meant to see if the empty
 * implementation of SVG renderer compiles
 * and runs when using the inherited methods.
 */
BOOST_AUTO_TEST_CASE(compile_test_case)
{
    using namespace mapnik;

    Map map(800, 600);

    try
    {
        std::ostringstream output_stream;
        std::ostream_iterator<char> output_stream_iterator(output_stream);
        svg_renderer<std::ostream_iterator<char> > renderer(map, output_stream_iterator);
        renderer.apply();
    }
    catch(...)
    {
        BOOST_FAIL("Empty implementation throws exception.");
    }
}