subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1849355 - in /subversion/trunk/subversion/bindings/cxx/tests: fixture_initialize_apr.hpp svnxx-tests.cpp test_aprwrap_pools.cpp
Date Thu, 20 Dec 2018 01:43:32 GMT
Author: brane
Date: Thu Dec 20 01:43:32 2018
New Revision: 1849355

URL: http://svn.apache.org/viewvc?rev=1849355&view=rev
Log:
Remove some clutter from the SVN++ tests.

* subversion/bindings/cxx/tests/fixture_initialize_apr.hpp:
   Removed; relevant contentes were moved to ...
* subversion/bindings/cxx/tests/fixture_initialize_apr.hpp: ... here.

* subversion/bindings/cxx/tests/test_aprwrap_pools.cpp:
   Don't include fixture_initialize_apr.hpp.

Removed:
    subversion/trunk/subversion/bindings/cxx/tests/fixture_initialize_apr.hpp
Modified:
    subversion/trunk/subversion/bindings/cxx/tests/svnxx-tests.cpp
    subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_pools.cpp

Modified: subversion/trunk/subversion/bindings/cxx/tests/svnxx-tests.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/tests/svnxx-tests.cpp?rev=1849355&r1=1849354&r2=1849355&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/tests/svnxx-tests.cpp (original)
+++ subversion/trunk/subversion/bindings/cxx/tests/svnxx-tests.cpp Thu Dec 20 01:43:32 2018
@@ -22,7 +22,34 @@
 #define BOOST_TEST_MODULE svnxx
 #include <boost/test/unit_test.hpp>
 
-#include "fixture_initialize_apr.hpp"
+#include <iostream>
+#include <stdexcept>
+
+#include <apr_general.h>
+
+
+struct initialize_apr_library
+{
+  initialize_apr_library()
+    {
+      const auto status = apr_initialize();
+      if (status)
+        {
+          char errbuf[512];
+          std::cerr << "APR initialization failed: "
+                    << apr_strerror(status, errbuf, sizeof(errbuf) - 1)
+                    << std::endl;
+          throw std::runtime_error("APR initialization failed");
+        }
+    }
+  ~initialize_apr_library()
+    {
+      apr_terminate();
+    }
+};
+
+BOOST_GLOBAL_FIXTURE(initialize_apr_library);
+
 
 int main (int argc, char* argv[])
 {

Modified: subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_pools.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_pools.cpp?rev=1849355&r1=1849354&r2=1849355&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_pools.cpp (original)
+++ subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_pools.cpp Thu Dec 20 01:43:32
2018
@@ -21,8 +21,6 @@
 
 #include <boost/test/unit_test.hpp>
 
-#include "fixture_initialize_apr.hpp"
-
 #include <algorithm>
 #include <stdexcept>
 



Mime
View raw message