From bc11d0a5e535e2d7566ebff44728098ee5be28d9 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 25 Sep 2007 21:06:52 +0000 Subject: [PATCH] - added some tests - added missing disclaimers --- include/mapnik/config_error.hpp | 22 + include/mapnik/enumeration.hpp | 22 + include/mapnik/libxml2_loader.hpp | 22 + include/mapnik/ptree_helpers.hpp | 22 + tests/data/broken_maps/amenity.xml | 86 ++ tests/data/broken_maps/bgcolor_broken.xml | 3 + tests/data/broken_maps/bool_value_broken.xml | 10 + tests/data/broken_maps/color_value_broken.xml | 11 + tests/data/broken_maps/css_value_broken.xml | 11 + .../broken_maps/datasource_type_broken.xml | 13 + .../broken_maps/datasource_type_missing.xml | 12 + tests/data/broken_maps/db_host_broken.xml | 16 + tests/data/broken_maps/db_user_broken.xml | 16 + tests/data/broken_maps/expression_broken.xml | 9 + tests/data/broken_maps/font_name_broken.xml | 9 + .../broken_maps/line_cap_style_broken.xml | 11 + .../broken_maps/line_join_style_broken.xml | 11 + .../line_pattern_symbolizer_broken.xml | 9 + .../broken_maps/max_scale_denom_broken.xml | 9 + .../broken_maps/min_scale_denom_broken.xml | 9 + tests/data/broken_maps/missing_icon.xml | 9 + .../broken_maps/point_symbolizer_broken.xml | 9 + .../polygon_pattern_symbolizer_broken.xml | 9 + .../broken_maps/shield_symbolizer_broken.xml | 10 + .../broken_maps/stroke_dasharray_broken.xml | 12 + tests/data/broken_maps/style_name_missing.xml | 5 + .../broken_maps/text_symbolizer_broken.xml | 9 + tests/data/broken_maps/xml_tag_mismatch.xml | 10 + tests/data/good_maps/bool_values.xml | 52 + tests/data/good_maps/osm-styles.xml | 1262 +++++++++++++++++ tests/data/good_maps/point_symbolizers.xml | 18 + ...whitespace_at_end_of_filter_expression.xml | 11 + tests/data/images/dummy.png | Bin 0 -> 216 bytes tests/python/test_load_map.py | 91 ++ tests/python/test_save_map.py | 76 + 35 files changed, 1916 insertions(+) create mode 100644 tests/data/broken_maps/amenity.xml create mode 100644 tests/data/broken_maps/bgcolor_broken.xml create mode 100644 tests/data/broken_maps/bool_value_broken.xml create mode 100644 tests/data/broken_maps/color_value_broken.xml create mode 100644 tests/data/broken_maps/css_value_broken.xml create mode 100644 tests/data/broken_maps/datasource_type_broken.xml create mode 100644 tests/data/broken_maps/datasource_type_missing.xml create mode 100644 tests/data/broken_maps/db_host_broken.xml create mode 100644 tests/data/broken_maps/db_user_broken.xml create mode 100644 tests/data/broken_maps/expression_broken.xml create mode 100644 tests/data/broken_maps/font_name_broken.xml create mode 100644 tests/data/broken_maps/line_cap_style_broken.xml create mode 100644 tests/data/broken_maps/line_join_style_broken.xml create mode 100644 tests/data/broken_maps/line_pattern_symbolizer_broken.xml create mode 100644 tests/data/broken_maps/max_scale_denom_broken.xml create mode 100644 tests/data/broken_maps/min_scale_denom_broken.xml create mode 100644 tests/data/broken_maps/missing_icon.xml create mode 100644 tests/data/broken_maps/point_symbolizer_broken.xml create mode 100644 tests/data/broken_maps/polygon_pattern_symbolizer_broken.xml create mode 100644 tests/data/broken_maps/shield_symbolizer_broken.xml create mode 100644 tests/data/broken_maps/stroke_dasharray_broken.xml create mode 100644 tests/data/broken_maps/style_name_missing.xml create mode 100644 tests/data/broken_maps/text_symbolizer_broken.xml create mode 100644 tests/data/broken_maps/xml_tag_mismatch.xml create mode 100644 tests/data/good_maps/bool_values.xml create mode 100644 tests/data/good_maps/osm-styles.xml create mode 100644 tests/data/good_maps/point_symbolizers.xml create mode 100644 tests/data/good_maps/whitespace_at_end_of_filter_expression.xml create mode 100644 tests/data/images/dummy.png create mode 100755 tests/python/test_load_map.py create mode 100755 tests/python/test_save_map.py diff --git a/include/mapnik/config_error.hpp b/include/mapnik/config_error.hpp index fcb5e7c52..275f795ae 100644 --- a/include/mapnik/config_error.hpp +++ b/include/mapnik/config_error.hpp @@ -1,3 +1,25 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2006 Artem Pavlenko + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + *****************************************************************************/ + #ifndef MAPNIK_CONFIG_ERROR_INCLUDED #define MAPNIK_CONFIG_ERROR_INCLUDED diff --git a/include/mapnik/enumeration.hpp b/include/mapnik/enumeration.hpp index c61c9b96d..602699b58 100644 --- a/include/mapnik/enumeration.hpp +++ b/include/mapnik/enumeration.hpp @@ -1,3 +1,25 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2006 Artem Pavlenko + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + *****************************************************************************/ + #ifndef MAPNIK_ENUMERATION_INCLUDED #define MAPNIK_ENUMERATION_INCLUDED diff --git a/include/mapnik/libxml2_loader.hpp b/include/mapnik/libxml2_loader.hpp index f2a7f1533..63ddcfe4e 100644 --- a/include/mapnik/libxml2_loader.hpp +++ b/include/mapnik/libxml2_loader.hpp @@ -1,3 +1,25 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2006 Artem Pavlenko + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + *****************************************************************************/ + #ifndef LOAD_MAP_XML2_INCLUDED #define LOAD_MAP_XML2_INCLUDED diff --git a/include/mapnik/ptree_helpers.hpp b/include/mapnik/ptree_helpers.hpp index f75496a5a..598520457 100644 --- a/include/mapnik/ptree_helpers.hpp +++ b/include/mapnik/ptree_helpers.hpp @@ -1,3 +1,25 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2006 Artem Pavlenko + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + *****************************************************************************/ + #ifndef MAPNIK_CONFIG_HELPERS_INCLUDED #define MAPNIK_CONFIG_HELPERS_INCLUDED diff --git a/tests/data/broken_maps/amenity.xml b/tests/data/broken_maps/amenity.xml new file mode 100644 index 000000000..5e800355c --- /dev/null +++ b/tests/data/broken_maps/amenity.xml @@ -0,0 +1,86 @@ + + diff --git a/tests/data/broken_maps/bgcolor_broken.xml b/tests/data/broken_maps/bgcolor_broken.xml new file mode 100644 index 000000000..5604b3051 --- /dev/null +++ b/tests/data/broken_maps/bgcolor_broken.xml @@ -0,0 +1,3 @@ + + + diff --git a/tests/data/broken_maps/bool_value_broken.xml b/tests/data/broken_maps/bool_value_broken.xml new file mode 100644 index 000000000..d3a1c1d6c --- /dev/null +++ b/tests/data/broken_maps/bool_value_broken.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/tests/data/broken_maps/color_value_broken.xml b/tests/data/broken_maps/color_value_broken.xml new file mode 100644 index 000000000..72292b109 --- /dev/null +++ b/tests/data/broken_maps/color_value_broken.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/tests/data/broken_maps/css_value_broken.xml b/tests/data/broken_maps/css_value_broken.xml new file mode 100644 index 000000000..56086d497 --- /dev/null +++ b/tests/data/broken_maps/css_value_broken.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/tests/data/broken_maps/datasource_type_broken.xml b/tests/data/broken_maps/datasource_type_broken.xml new file mode 100644 index 000000000..4a060d9b4 --- /dev/null +++ b/tests/data/broken_maps/datasource_type_broken.xml @@ -0,0 +1,13 @@ + + + + + + foobar_db + some_one + SECRET + gis + + + + diff --git a/tests/data/broken_maps/datasource_type_missing.xml b/tests/data/broken_maps/datasource_type_missing.xml new file mode 100644 index 000000000..bac8281f0 --- /dev/null +++ b/tests/data/broken_maps/datasource_type_missing.xml @@ -0,0 +1,12 @@ + + + + + + some_one + SECRET + gis + + + + diff --git a/tests/data/broken_maps/db_host_broken.xml b/tests/data/broken_maps/db_host_broken.xml new file mode 100644 index 000000000..0480113c9 --- /dev/null +++ b/tests/data/broken_maps/db_host_broken.xml @@ -0,0 +1,16 @@ + + + +]> + + + + postgis + &db_host; + SECRET + &db_name; + + + + diff --git a/tests/data/broken_maps/db_user_broken.xml b/tests/data/broken_maps/db_user_broken.xml new file mode 100644 index 000000000..a6d13ed28 --- /dev/null +++ b/tests/data/broken_maps/db_user_broken.xml @@ -0,0 +1,16 @@ + + + +]> + + + + postgis + &db_user; + SECRET + &db_name; + + + + diff --git a/tests/data/broken_maps/expression_broken.xml b/tests/data/broken_maps/expression_broken.xml new file mode 100644 index 000000000..a0420e45f --- /dev/null +++ b/tests/data/broken_maps/expression_broken.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/tests/data/broken_maps/font_name_broken.xml b/tests/data/broken_maps/font_name_broken.xml new file mode 100644 index 000000000..95a306c79 --- /dev/null +++ b/tests/data/broken_maps/font_name_broken.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/tests/data/broken_maps/line_cap_style_broken.xml b/tests/data/broken_maps/line_cap_style_broken.xml new file mode 100644 index 000000000..92298999d --- /dev/null +++ b/tests/data/broken_maps/line_cap_style_broken.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/tests/data/broken_maps/line_join_style_broken.xml b/tests/data/broken_maps/line_join_style_broken.xml new file mode 100644 index 000000000..736e0a7dd --- /dev/null +++ b/tests/data/broken_maps/line_join_style_broken.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/tests/data/broken_maps/line_pattern_symbolizer_broken.xml b/tests/data/broken_maps/line_pattern_symbolizer_broken.xml new file mode 100644 index 000000000..7101aec51 --- /dev/null +++ b/tests/data/broken_maps/line_pattern_symbolizer_broken.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/tests/data/broken_maps/max_scale_denom_broken.xml b/tests/data/broken_maps/max_scale_denom_broken.xml new file mode 100644 index 000000000..60ada9ca4 --- /dev/null +++ b/tests/data/broken_maps/max_scale_denom_broken.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/tests/data/broken_maps/min_scale_denom_broken.xml b/tests/data/broken_maps/min_scale_denom_broken.xml new file mode 100644 index 000000000..3c68435a9 --- /dev/null +++ b/tests/data/broken_maps/min_scale_denom_broken.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/tests/data/broken_maps/missing_icon.xml b/tests/data/broken_maps/missing_icon.xml new file mode 100644 index 000000000..cd3687c56 --- /dev/null +++ b/tests/data/broken_maps/missing_icon.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/tests/data/broken_maps/point_symbolizer_broken.xml b/tests/data/broken_maps/point_symbolizer_broken.xml new file mode 100644 index 000000000..b89849777 --- /dev/null +++ b/tests/data/broken_maps/point_symbolizer_broken.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/tests/data/broken_maps/polygon_pattern_symbolizer_broken.xml b/tests/data/broken_maps/polygon_pattern_symbolizer_broken.xml new file mode 100644 index 000000000..455f24929 --- /dev/null +++ b/tests/data/broken_maps/polygon_pattern_symbolizer_broken.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/tests/data/broken_maps/shield_symbolizer_broken.xml b/tests/data/broken_maps/shield_symbolizer_broken.xml new file mode 100644 index 000000000..9d58f4e47 --- /dev/null +++ b/tests/data/broken_maps/shield_symbolizer_broken.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/tests/data/broken_maps/stroke_dasharray_broken.xml b/tests/data/broken_maps/stroke_dasharray_broken.xml new file mode 100644 index 000000000..ad3de7def --- /dev/null +++ b/tests/data/broken_maps/stroke_dasharray_broken.xml @@ -0,0 +1,12 @@ + + + + + diff --git a/tests/data/broken_maps/style_name_missing.xml b/tests/data/broken_maps/style_name_missing.xml new file mode 100644 index 000000000..5d95cb15a --- /dev/null +++ b/tests/data/broken_maps/style_name_missing.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/tests/data/broken_maps/xml_tag_mismatch.xml b/tests/data/broken_maps/xml_tag_mismatch.xml new file mode 100644 index 000000000..480bd1b92 --- /dev/null +++ b/tests/data/broken_maps/xml_tag_mismatch.xml @@ -0,0 +1,10 @@ + + + + + + + + + + + + diff --git a/tests/data/good_maps/osm-styles.xml b/tests/data/good_maps/osm-styles.xml new file mode 100644 index 000000000..0d5c79eae --- /dev/null +++ b/tests/data/good_maps/osm-styles.xml @@ -0,0 +1,1262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/data/good_maps/point_symbolizers.xml b/tests/data/good_maps/point_symbolizers.xml new file mode 100644 index 000000000..a016a7544 --- /dev/null +++ b/tests/data/good_maps/point_symbolizers.xml @@ -0,0 +1,18 @@ + + + + + + diff --git a/tests/data/good_maps/whitespace_at_end_of_filter_expression.xml b/tests/data/good_maps/whitespace_at_end_of_filter_expression.xml new file mode 100644 index 000000000..d6454d77a --- /dev/null +++ b/tests/data/good_maps/whitespace_at_end_of_filter_expression.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/tests/data/images/dummy.png b/tests/data/images/dummy.png new file mode 100644 index 0000000000000000000000000000000000000000..8b8c5fd22a424d03d4acf90d42f2bfc5a7a372e7 GIT binary patch literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#IwwD`f{gq@`E@`c*%H@?66gHf+|;}h2Ir#G#FEq$h4Rdj426)4R0VfW-+=ci zs(C<#ex5FlAsXkWUb5z5FyLUhc=OKxbIUkc4z6Fi=b+of{>Tkiyp}sId%WO+