summaryrefslogtreecommitdiff
path: root/slicer/test/preprocessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'slicer/test/preprocessor.cpp')
-rw-r--r--slicer/test/preprocessor.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/slicer/test/preprocessor.cpp b/slicer/test/preprocessor.cpp
index f4c75fc..430efd9 100644
--- a/slicer/test/preprocessor.cpp
+++ b/slicer/test/preprocessor.cpp
@@ -13,8 +13,33 @@
namespace fs = boost::filesystem;
+const unsigned int COMPONENTS_IN_TEST_ICE = 24;
+
BOOST_FIXTURE_TEST_SUITE ( preprocessor, FileStructure );
+BOOST_AUTO_TEST_CASE( slicer_test_counts_path )
+{
+ auto count = Slicer::Slicer::Apply(slice, boost::filesystem::path("/dev/null"));
+ BOOST_REQUIRE_EQUAL(COMPONENTS_IN_TEST_ICE, count);
+}
+
+BOOST_AUTO_TEST_CASE( slicer_test_counts_filestar )
+{
+ FILE * file = fopen("/dev/null", "a");
+ BOOST_REQUIRE(file);
+
+ auto count = Slicer::Slicer::Apply(slice, file);
+ BOOST_REQUIRE_EQUAL(COMPONENTS_IN_TEST_ICE, count);
+
+ fclose(file);
+}
+
+BOOST_AUTO_TEST_CASE( slicer_test_counts_nullfilestar )
+{
+ auto count = Slicer::Slicer::Apply(slice, NULL);
+ BOOST_REQUIRE_EQUAL(COMPONENTS_IN_TEST_ICE, count);
+}
+
BOOST_AUTO_TEST_CASE( slicer_test_ice )
{
const fs::path cpp = fs::change_extension(tmp / base, ".cpp");