diff options
Diffstat (limited to 'slicer/test/preprocessor.cpp')
-rw-r--r-- | slicer/test/preprocessor.cpp | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/slicer/test/preprocessor.cpp b/slicer/test/preprocessor.cpp index fe789d0..454d58a 100644 --- a/slicer/test/preprocessor.cpp +++ b/slicer/test/preprocessor.cpp @@ -1,34 +1,23 @@ #define BOOST_TEST_MODULE preprocess #include <boost/test/unit_test.hpp> -#include <tool/parser.h> -#include <common.h> +#include "helpers.h" #include <boost/format.hpp> #include <buffer.h> +#include <common.h> #include <definedDirs.h> -#include "helpers.h" +#include <tool/parser.h> using ComponentsCount = std::map<std::string, unsigned int>; -ComponentsCount COMPONENTS_IN_TEST_ICE = { - { "classtype.ice", 1 }, - { "classes.ice", 3 }, - { "collections.ice", 6 }, - { "enums.ice", 2 }, - { "inheritance.ice", 12 }, - { "interfaces.ice", 0 }, - { "json.ice", 2 }, - { "locals.ice", 7 }, - { "optionals.ice", 2 }, - { "structs.ice", 4 }, - { "types.ice", 3 }, - { "xml.ice", 5 } -}; +ComponentsCount COMPONENTS_IN_TEST_ICE = {{"classtype.ice", 1}, {"classes.ice", 3}, {"collections.ice", 6}, + {"enums.ice", 2}, {"inheritance.ice", 12}, {"interfaces.ice", 0}, {"json.ice", 2}, {"locals.ice", 7}, + {"optionals.ice", 2}, {"structs.ice", 4}, {"types.ice", 3}, {"xml.ice", 5}}; unsigned int total() { unsigned int t = 0; - for(const auto & c : COMPONENTS_IN_TEST_ICE) { + for (const auto & c : COMPONENTS_IN_TEST_ICE) { t += c.second; } return t; @@ -52,21 +41,21 @@ processAll(Slicer::Slicer & s) { s.includes.push_back(rootDir / "included"); s.includes.push_back(rootDir); - for(const auto & c : COMPONENTS_IN_TEST_ICE) { + for (const auto & c : COMPONENTS_IN_TEST_ICE) { BOOST_TEST_CHECKPOINT(c.first); process(s, c); } BOOST_REQUIRE_EQUAL(total(), s.Components()); } -BOOST_AUTO_TEST_CASE( slicer_test_counts_path ) +BOOST_AUTO_TEST_CASE(slicer_test_counts_path) { Slicer::Slicer s; s.cppPath = "/dev/null"; processAll(s); } -BOOST_AUTO_TEST_CASE( slicer_test_counts_filestar ) +BOOST_AUTO_TEST_CASE(slicer_test_counts_filestar) { FILE * file = fopen("/dev/null", "a"); BOOST_REQUIRE(file); @@ -76,9 +65,8 @@ BOOST_AUTO_TEST_CASE( slicer_test_counts_filestar ) fclose(file); } -BOOST_AUTO_TEST_CASE( slicer_test_counts_nullfilestar ) +BOOST_AUTO_TEST_CASE(slicer_test_counts_nullfilestar) { Slicer::Slicer s; processAll(s); } - |