From 53417619c01ff246b272889f888e9efe766f579f Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Sun, 12 Nov 2017 20:20:05 +0100 Subject: [PATCH] cleanup a few data_out_base_vtu tests --- tests/base/data_out_base_vtu.cc | 25 +++--------------- tests/base/data_out_base_vtu_cycle.cc | 26 ++++--------------- tests/base/data_out_base_vtu_time.cc | 25 +++--------------- .../base/data_out_base_vtu_time_and_cycle.cc | 25 +++--------------- 4 files changed, 17 insertions(+), 84 deletions(-) diff --git a/tests/base/data_out_base_vtu.cc b/tests/base/data_out_base_vtu.cc index 10e8b27c02..510ac6ab23 100644 --- a/tests/base/data_out_base_vtu.cc +++ b/tests/base/data_out_base_vtu.cc @@ -24,10 +24,6 @@ // Output data on repetitions of the unit hypercube -// define this as 1 to get output into a separate file for each testcase -#define SEPARATE_FILES 0 - - template void check(DataOutBase::VtkFlags flags, std::ostream &out) @@ -52,24 +48,11 @@ void check(DataOutBase::VtkFlags flags, template void check_all(std::ostream &log) { -#if SEPARATE_FILES == 0 - std::ostream &out = log; -#endif - - char name[100]; DataOutBase::VtkFlags flags; - if (true) - { - sprintf(name, "%d%d.vtu", dim, spacedim); -#if SEPARATE_FILES==1 - std::ofstream out(name); -#else - out << "==============================\n" - << name - << "\n==============================\n"; -#endif - check(flags, out); - } + log << "==============================" << std::endl + << dim << spacedim << ".vtu" << std::endl + << "==============================" << std::endl; + check(flags, log); } int main() diff --git a/tests/base/data_out_base_vtu_cycle.cc b/tests/base/data_out_base_vtu_cycle.cc index bcdea18f59..8751403558 100644 --- a/tests/base/data_out_base_vtu_cycle.cc +++ b/tests/base/data_out_base_vtu_cycle.cc @@ -26,10 +26,6 @@ // Output data on repetitions of the unit hypercube -// define this as 1 to get output into a separate file for each testcase -#define SEPARATE_FILES 0 - - template void check(DataOutBase::VtkFlags flags, std::ostream &out) @@ -54,27 +50,15 @@ void check(DataOutBase::VtkFlags flags, template void check_all(std::ostream &log) { -#if SEPARATE_FILES == 0 - std::ostream &out = log; -#endif - - char name[100]; DataOutBase::VtkFlags flags; flags.cycle = 42; - if (true) - { - sprintf(name, "%d%d.vtu", dim, spacedim); -#if SEPARATE_FILES==1 - std::ofstream out(name); -#else - out << "==============================\n" - << name - << "\n==============================\n"; -#endif - check(flags, out); - } + log << "==============================" << std::endl + << dim << spacedim << ".vtu" << std::endl + << "==============================" << std::endl; + check(flags, log); + } int main() diff --git a/tests/base/data_out_base_vtu_time.cc b/tests/base/data_out_base_vtu_time.cc index 5e82d1224b..5de2535bd6 100644 --- a/tests/base/data_out_base_vtu_time.cc +++ b/tests/base/data_out_base_vtu_time.cc @@ -26,10 +26,6 @@ // Output data on repetitions of the unit hypercube -// define this as 1 to get output into a separate file for each testcase -#define SEPARATE_FILES 0 - - template void check(DataOutBase::VtkFlags flags, std::ostream &out) @@ -54,27 +50,14 @@ void check(DataOutBase::VtkFlags flags, template void check_all(std::ostream &log) { -#if SEPARATE_FILES == 0 - std::ostream &out = log; -#endif - - char name[100]; DataOutBase::VtkFlags flags; flags.time = numbers::PI; - if (true) - { - sprintf(name, "%d%d.vtu", dim, spacedim); -#if SEPARATE_FILES==1 - std::ofstream out(name); -#else - out << "==============================\n" - << name - << "\n==============================\n"; -#endif - check(flags, out); - } + log << "==============================" << std::endl + << dim << spacedim << ".vtu" << std::endl + << "==============================" << std::endl; + check(flags, log); } int main() diff --git a/tests/base/data_out_base_vtu_time_and_cycle.cc b/tests/base/data_out_base_vtu_time_and_cycle.cc index 8b3e67f7c7..b3620c5d74 100644 --- a/tests/base/data_out_base_vtu_time_and_cycle.cc +++ b/tests/base/data_out_base_vtu_time_and_cycle.cc @@ -27,10 +27,6 @@ // Output data on repetitions of the unit hypercube -// define this as 1 to get output into a separate file for each testcase -#define SEPARATE_FILES 0 - - template void check(DataOutBase::VtkFlags flags, std::ostream &out) @@ -55,28 +51,15 @@ void check(DataOutBase::VtkFlags flags, template void check_all(std::ostream &log) { -#if SEPARATE_FILES == 0 - std::ostream &out = log; -#endif - - char name[100]; DataOutBase::VtkFlags flags; flags.time = numbers::PI; flags.cycle = 42; - if (true) - { - sprintf(name, "%d%d.vtu", dim, spacedim); -#if SEPARATE_FILES==1 - std::ofstream out(name); -#else - out << "==============================\n" - << name - << "\n==============================\n"; -#endif - check(flags, out); - } + log << "==============================" << std::endl + << dim << spacedim << ".vtu" << std::endl + << "==============================" << std::endl; + check(flags, log); } int main() -- 2.39.5