google test: util: Migrate configuration_black. (#6018)
authorAina Niemetz <aina.niemetz@gmail.com>
Mon, 1 Mar 2021 13:07:19 +0000 (05:07 -0800)
committerGitHub <noreply@github.com>
Mon, 1 Mar 2021 13:07:19 +0000 (13:07 +0000)
test/unit/util/CMakeLists.txt
test/unit/util/configuration_black.cpp [new file with mode: 0644]
test/unit/util/configuration_black.h [deleted file]

index 4d644acfea1f247780889154ae19d63b5cd47804..54004ff471f9e1f170598fde73f47b90794d5269 100644 (file)
@@ -18,7 +18,7 @@ cvc4_add_cxx_unit_test_black(bitvector_black util)
 cvc4_add_unit_test_black(boolean_simplification_black util)
 cvc4_add_unit_test_black(cardinality_black util)
 cvc4_add_unit_test_white(check_white util)
-cvc4_add_cxx_unit_test_black(configuration_black util)
+cvc4_add_unit_test_black(configuration_black util)
 cvc4_add_cxx_unit_test_black(datatype_black util)
 cvc4_add_unit_test_black(exception_black util)
 if(CVC4_USE_SYMFPU)
diff --git a/test/unit/util/configuration_black.cpp b/test/unit/util/configuration_black.cpp
new file mode 100644 (file)
index 0000000..2dc26d1
--- /dev/null
@@ -0,0 +1,99 @@
+/*********************                                                        */
+/*! \file configuration_black.cpp
+ ** \verbatim
+ ** Top contributors (to current version):
+ **   Morgan Deters, Aina Niemetz
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS
+ ** in the top-level source directory and their institutional affiliations.
+ ** All rights reserved.  See the file COPYING in the top-level source
+ ** directory for licensing information.\endverbatim
+ **
+ ** \brief Black box testing of CVC4::Configuration.
+ **
+ ** Black box testing of CVC4::Configuration.
+ **/
+
+#include "base/configuration.h"
+#include "test.h"
+
+namespace CVC4 {
+namespace test {
+
+class TestUtilBlackConfiguration : public TestInternal
+{
+};
+
+TEST_F(TestUtilBlackConfiguration, static_flags)
+{
+  const bool debug =
+#ifdef CVC4_DEBUG
+      true;
+#else  /* CVC4_DEBUG */
+      false;
+#endif /* CVC4_DEBUG */
+
+  const bool tracing =
+#ifdef CVC4_TRACING
+      true;
+#else  /* CVC4_TRACING */
+      false;
+#endif /* CVC4_TRACING */
+
+  const bool muzzled =
+#ifdef CVC4_MUZZLE
+      true;
+#else  /* CVC4_MUZZLE */
+      false;
+#endif /* CVC4_MUZZLE */
+
+  const bool assertions =
+#ifdef CVC4_ASSERTIONS
+      true;
+#else  /* CVC4_ASSERTIONS */
+      false;
+#endif /* CVC4_ASSERTIONS */
+
+  const bool coverage =
+#ifdef CVC4_COVERAGE
+      true;
+#else  /* CVC4_COVERAGE */
+      false;
+#endif /* CVC4_COVERAGE */
+
+  const bool profiling =
+#ifdef CVC4_PROFILING
+      true;
+#else  /* CVC4_PROFILING */
+      false;
+#endif /* CVC4_PROFILING */
+
+  ASSERT_EQ(Configuration::isDebugBuild(), debug);
+  ASSERT_EQ(Configuration::isTracingBuild(), tracing);
+  ASSERT_EQ(Configuration::isMuzzledBuild(), muzzled);
+  ASSERT_EQ(Configuration::isAssertionBuild(), assertions);
+  ASSERT_EQ(Configuration::isCoverageBuild(), coverage);
+  ASSERT_EQ(Configuration::isProfilingBuild(), profiling);
+}
+
+TEST_F(TestUtilBlackConfiguration, package_name)
+{
+  ASSERT_EQ(Configuration::getPackageName(), "cvc4");
+}
+
+TEST_F(TestUtilBlackConfiguration, versions)
+{
+  // just test that the functions exist
+  Configuration::getVersionString();
+  Configuration::getVersionMajor();
+  Configuration::getVersionMinor();
+  Configuration::getVersionRelease();
+}
+
+TEST_F(TestUtilBlackConfiguration, about)
+{
+  // just test that the function exists
+  Configuration::about();
+}
+}  // namespace test
+}  // namespace CVC4
diff --git a/test/unit/util/configuration_black.h b/test/unit/util/configuration_black.h
deleted file mode 100644 (file)
index ef9234a..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*********************                                                        */
-/*! \file configuration_black.h
- ** \verbatim
- ** Top contributors (to current version):
- **   Morgan Deters
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS
- ** in the top-level source directory and their institutional affiliations.
- ** All rights reserved.  See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief Black box testing of CVC4::Configuration.
- **
- ** Black box testing of CVC4::Configuration.
- **/
-
-#include <cxxtest/TestSuite.h>
-
-#include "base/configuration.h"
-
-using namespace CVC4;
-using namespace std;
-
-class ConfigurationBlack : public CxxTest::TestSuite {
-
-public:
-
-  void testStaticFlags() {
-    const bool debug =
-#ifdef CVC4_DEBUG
-      true;
-#else /* CVC4_DEBUG */
-      false;
-#endif /* CVC4_DEBUG */
-
-    const bool tracing =
-#ifdef CVC4_TRACING
-      true;
-#else /* CVC4_TRACING */
-      false;
-#endif /* CVC4_TRACING */
-
-    const bool muzzled =
-#ifdef CVC4_MUZZLE
-      true;
-#else /* CVC4_MUZZLE */
-      false;
-#endif /* CVC4_MUZZLE */
-
-    const bool assertions =
-#ifdef CVC4_ASSERTIONS
-      true;
-#else /* CVC4_ASSERTIONS */
-      false;
-#endif /* CVC4_ASSERTIONS */
-
-    const bool coverage =
-#ifdef CVC4_COVERAGE
-      true;
-#else /* CVC4_COVERAGE */
-      false;
-#endif /* CVC4_COVERAGE */
-
-    const bool profiling =
-#ifdef CVC4_PROFILING
-      true;
-#else /* CVC4_PROFILING */
-      false;
-#endif /* CVC4_PROFILING */
-
-    TS_ASSERT( Configuration::isDebugBuild() == debug );
-    TS_ASSERT( Configuration::isTracingBuild() == tracing );
-    TS_ASSERT( Configuration::isMuzzledBuild() == muzzled );
-    TS_ASSERT( Configuration::isAssertionBuild() == assertions );
-    TS_ASSERT( Configuration::isCoverageBuild() == coverage );
-    TS_ASSERT( Configuration::isProfilingBuild() == profiling );
-  }
-
-  void testPackageName() {
-    TS_ASSERT( Configuration::getPackageName() == "cvc4" );
-  }
-
-  void testVersions() {
-    // just test that the functions exist
-    Configuration::getVersionString();
-    Configuration::getVersionMajor();
-    Configuration::getVersionMinor();
-    Configuration::getVersionRelease();
-  }
-
-  void testAbout() {
-    // just test that the function exists
-    Configuration::about();
-  }
-
-};