Author: brane
Date: Tue Dec 25 20:34:51 2018
New Revision: 1849722

URL: http://svn.apache.org/viewvc?rev=1849722&view=rev
Log:
Rework the APR pools wrapper in SVN++ to use C++11 constructs.

[in subversion/bindings/cxx]
* src/aprwrap.hpp
  (apr): Provide a new namespace alias for the wrapped APR functionality.

* src/aprwrap/pool.hpp: Include <memory>
  (apr::delete_pool): Deleter for std::unique_ptr that contains a pool.
  (apr::pool_ptr): Specialization of std::unique_ptr for pools.
  (apr::pool): Renamed from APR::Pool; derives from pool_ptr.
  (apr::pool::iteration): Renamed from APR::Pool::Iteration.
  (APR::IterationPool): Removed, it's no longer needed.

* src/exception.cpp,
  src/aprwrap/array.hpp,
  src/aprwrap/hash.hpp,
  src/aprwrap/impl.cpp,
  tests/test_aprwrap_array_helpers.hpp,
  tests/test_aprwrap_arrays.cpp,
  tests/test_aprwrap_const_arrays.cpp,
  tests/test_aprwrap_hashes.cpp,
  tests/test_aprwrap_pools.cpp: Rename APR::Pool to apr::pool, rename
   APR::Pool::Iteration to apr::pool::iteration and use apr::pool instead
   of APR::IterationPool.

Modified:
    subversion/trunk/subversion/bindings/cxx/src/aprwrap.hpp
    subversion/trunk/subversion/bindings/cxx/src/aprwrap/array.hpp
    subversion/trunk/subversion/bindings/cxx/src/aprwrap/hash.hpp
    subversion/trunk/subversion/bindings/cxx/src/aprwrap/impl.cpp
    subversion/trunk/subversion/bindings/cxx/src/aprwrap/pool.hpp
    subversion/trunk/subversion/bindings/cxx/src/exception.cpp
    
subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_array_helpers.hpp
    subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_arrays.cpp
    subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_const_arrays.cpp
    subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_hashes.cpp
    subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_pools.cpp

Modified: subversion/trunk/subversion/bindings/cxx/src/aprwrap.hpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/src/aprwrap.hpp?rev=1849722&r1=1849721&r2=1849722&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/src/aprwrap.hpp (original)
+++ subversion/trunk/subversion/bindings/cxx/src/aprwrap.hpp Tue Dec 25 
20:34:51 2018
@@ -29,6 +29,7 @@
 #include "aprwrap/hash.hpp"
 #include "aprwrap/array.hpp"
 
+namespace apr = ::apache::subversion::svnxx::apr;
 namespace APR = ::apache::subversion::svnxx::apr;
 
 #endif // SVNXX_PRIVATE_APRWRAP_H

Modified: subversion/trunk/subversion/bindings/cxx/src/aprwrap/array.hpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/src/aprwrap/array.hpp?rev=1849722&r1=1849721&r2=1849722&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/src/aprwrap/array.hpp (original)
+++ subversion/trunk/subversion/bindings/cxx/src/aprwrap/array.hpp Tue Dec 25 
20:34:51 2018
@@ -50,11 +50,11 @@ public:
   typedef int size_type;
 
   /**
-   * Create and proxy a new APR array allocated from @a pool.
+   * Create and proxy a new APR array allocated from @a result_pool.
    * Reserve space for @a nelts array elements.
    */
-  explicit Array(const Pool& pool, size_type nelts = 0) throw()
-    : m_array(apr_array_make(pool.get(), nelts, sizeof(value_type)))
+  explicit Array(const pool& result_pool, size_type nelts = 0) throw()
+    : m_array(apr_array_make(result_pool.get(), nelts, sizeof(value_type)))
     {}
 
   /**

Modified: subversion/trunk/subversion/bindings/cxx/src/aprwrap/hash.hpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/src/aprwrap/hash.hpp?rev=1849722&r1=1849721&r2=1849722&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/src/aprwrap/hash.hpp (original)
+++ subversion/trunk/subversion/bindings/cxx/src/aprwrap/hash.hpp Tue Dec 25 
20:34:51 2018
@@ -53,7 +53,7 @@ public:
    *
    * FIXME: should use std::function instead.
    */
-  void iterate(Iteration& callback, const Pool& scratch_pool);
+  void iterate(Iteration& callback, const pool& scratch_pool);
 
 public:
   /**
@@ -95,7 +95,7 @@ public:
     /**
      * The hash table wrapper must be able to call the protected constructor.
      */
-    friend void Hash::iterate(Hash::Iteration&, const Pool&);
+    friend void Hash::iterate(Hash::Iteration&, const pool&);
 
   private:
     const key_type m_key;       ///< Immutable reference to the key
@@ -108,18 +108,18 @@ public:
   typedef unsigned int size_type;
 
   /**
-   * Create and proxy a new APR hash table in @a pool.
+   * Create and proxy a new APR hash table in @a result_pool.
    */
-  explicit Hash(const Pool& pool) throw()
-    : m_hash(apr_hash_make(pool.get()))
+  explicit Hash(const pool& result_pool) throw()
+    : m_hash(apr_hash_make(result_pool.get()))
     {}
 
   /**
-   * Create and proxy a new APR hash table in @a pool, using @a
+   * Create and proxy a new APR hash table in @a result_pool, using @a
    * hash_func as the hash function.
    */
-  explicit Hash(const Pool& pool, apr_hashfunc_t hash_func) throw()
-    : m_hash(apr_hash_make_custom(pool.get(), hash_func))
+  explicit Hash(const pool& result_pool, apr_hashfunc_t hash_func) throw()
+    : m_hash(apr_hash_make_custom(result_pool.get(), hash_func))
     {}
 
   /**
@@ -267,18 +267,18 @@ public:
   typedef V* value_type;
 
   /**
-   * Create and proxy a new APR hash table allocated from @a pool.
+   * Create and proxy a new APR hash table allocated from @a result_pool.
    */
-  explicit Hash(const Pool& pool) throw()
-    : inherited(pool)
+  explicit Hash(const pool& result_pool) throw()
+    : inherited(result_pool)
     {}
 
   /**
-   * Create and proxy a new APR hash table allocated from @a pool,
+   * Create and proxy a new APR hash table allocated from @a result_pool,
    * using @a hash_func as the hash function.
    */
-  explicit Hash(const Pool& pool, apr_hashfunc_t hash_func) throw()
-    : inherited(pool, hash_func)
+  explicit Hash(const pool& result_pool, apr_hashfunc_t hash_func) throw()
+    : inherited(result_pool, hash_func)
     {}
 
   /**
@@ -340,7 +340,7 @@ public:
     virtual bool operator() (const Key& key, value_type value) = 0;
 
   private:
-    friend void Hash::iterate(Iteration& callback, const Pool& scratch_pool);
+    friend void Hash::iterate(Iteration& callback, const pool& scratch_pool);
 
     /**
      * Implementation of the derived virtual operator().
@@ -358,7 +358,7 @@ public:
    * @a callback for each pair.
    * Uses @a scratch_pool for temporary allocations.
    */
-  void iterate(Iteration& callback, const Pool& scratch_pool)
+  void iterate(Iteration& callback, const pool& scratch_pool)
     {
       inherited::iterate(callback, scratch_pool);
     }

Modified: subversion/trunk/subversion/bindings/cxx/src/aprwrap/impl.cpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/src/aprwrap/impl.cpp?rev=1849722&r1=1849721&r2=1849722&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/src/aprwrap/impl.cpp (original)
+++ subversion/trunk/subversion/bindings/cxx/src/aprwrap/impl.cpp Tue Dec 25 
20:34:51 2018
@@ -35,7 +35,7 @@ namespace apr {
 // Pool implementation
 //
 
-apr_pool_t* Pool::get_root_pool()
+apr_pool_t* pool::get_root_pool()
 {
   auto ctx = detail::context::get();
   return ctx->get_root_pool();
@@ -46,7 +46,7 @@ apr_pool_t* Pool::get_root_pool()
 //
 
 void Hash<void, void>::iterate(Hash<void, void>::Iteration& callback,
-                               const Pool& scratch_pool)
+                               const pool& scratch_pool)
 {
   for (apr_hash_index_t* hi = apr_hash_first(scratch_pool.get(), m_hash);
        hi; hi = apr_hash_next(hi))

Modified: subversion/trunk/subversion/bindings/cxx/src/aprwrap/pool.hpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/src/aprwrap/pool.hpp?rev=1849722&r1=1849721&r2=1849722&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/src/aprwrap/pool.hpp (original)
+++ subversion/trunk/subversion/bindings/cxx/src/aprwrap/pool.hpp Tue Dec 25 
20:34:51 2018
@@ -25,6 +25,7 @@
 #define SVNXX_PRIVATE_APRWRAP_POOL_H
 
 #include <cstdlib>
+#include <memory>
 
 #include "svnxx/exception.hpp"
 #include "svnxx/noncopyable.hpp"
@@ -36,51 +37,58 @@ namespace subversion {
 namespace svnxx {
 namespace apr {
 
-// Forward declaration
-class IterationPool;
+struct delete_pool
+{
+  void operator() (apr_pool_t* pool)
+    {
+      svn_pool_destroy(pool);
+    }
+};
+
+using pool_ptr = std::unique_ptr<apr_pool_t, delete_pool>;
 
 /**
  * Encapsulates an APR pool.
  */
-class Pool : detail::noncopyable
+class pool : pool_ptr
 {
-public:
-  /**
-   * Create a pool as a child of the applications' root pool.
-   */
-  Pool()
-    : m_pool(svn_pool_create(get_root_pool()))
-    {}
+  friend class iteration;
+  struct iteration_proxy
+  {
+    pool& proxied_pool;
+  };
+
+  static apr_pool_t* get_root_pool();
 
+public:
   /**
-   * Create a pool as a child of @a parent.
+   * Create a pool as a child of the application's root pool.
    */
-  explicit Pool(Pool* parent) throw()
-    : m_pool(svn_pool_create(parent->m_pool))
+  pool()
+    : pool_ptr(svn_pool_create(get_root_pool()))
     {}
 
   /**
-   * Destroy the pool.
+   * Retuurn a pool pointer that can be used by the C APIs.
    */
-  ~Pool() throw()
+  apr_pool_t* get() const noexcept
     {
-      svn_pool_destroy(m_pool);
+      return pool_ptr::get();
     }
 
   /**
-   * Clear the pool.
+   * Create a pool as a child of @a parent.
    */
-  void clear() throw()
-    {
-      apr_pool_clear(m_pool);
-    }
+  explicit pool(const pool* parent) noexcept
+    : pool_ptr(svn_pool_create(parent->get()))
+    {}
 
   /**
-   * Retuurn a pool pointer that can be used by the C APIs.
+   * Clear the pool.
    */
-  apr_pool_t* get() const throw()
+  void clear() noexcept
     {
-      return m_pool;
+      apr_pool_clear(get());
     }
 
   /**
@@ -88,9 +96,9 @@ public:
    * The contents of the allocated buffer will contain unspecified data.
    */
   template<typename T>
-  T* alloc(std::size_t count) throw()
+  T* alloc(std::size_t count) noexcept
     {
-      return static_cast<T*>(apr_palloc(m_pool, count * sizeof(T)));
+      return static_cast<T*>(apr_palloc(get(), count * sizeof(T)));
     }
 
   /**
@@ -98,14 +106,14 @@ public:
    * The contents of the allocated buffer will be initialized to zero.
    */
   template<typename T>
-  T* allocz(std::size_t count) throw()
+  T* allocz(std::size_t count) noexcept
     {
-      return static_cast<T*>(apr_pcalloc(m_pool, count * sizeof(T)));
+      return static_cast<T*>(apr_pcalloc(get(), count * sizeof(T)));
+    }
+  operator iteration_proxy() noexcept
+    {
+      return iteration_proxy{*this};
     }
-
-private:
-  static apr_pool_t* get_root_pool();
-  apr_pool_t* const m_pool;
 
 public:
   /**
@@ -114,80 +122,57 @@ public:
    * Construct this object inside a loop body in order to clear the
    * proxied pool on every iteration.
    */
-  class Iteration : detail::noncopyable
+  class iteration : detail::noncopyable
   {
   public:
     /**
      * The constructor clears the proxied pool.
      */
-    explicit Iteration(IterationPool& iterbase) throw();
+    explicit iteration(pool::iteration_proxy iterbase) noexcept
+      : proxied(iterbase.proxied_pool)
+      {
+        proxied.clear();
+      }
 
     /**
      * Returns a reference to the proxied pool.
      */
-    Pool& pool() const throw()
+    apr::pool& pool() const noexcept
       {
-        return m_pool;
+        return proxied;
       }
 
     /**
-     * Proxy method for Pool::get
+     * proxy method for pool::get()
      */
-    apr_pool_t* get() const throw()
+    apr_pool_t* get() const noexcept
       {
-        return m_pool.get();
+        return proxied.get();
       }
 
     /**
-     * Proxy method for Pool::alloc
+     * Proxy method for pool::alloc()
      */
     template<typename T>
-    T* alloc(std::size_t count) throw()
+    T* alloc(std::size_t count) noexcept
       {
-        return m_pool.alloc<T>(count);
+        return proxied.alloc<T>(count);
       }
 
     /**
-     * Proxy method for Pool::allocz
+     * Proxy method for pool::allocz()
      */
     template<typename T>
-    T* allocz(std::size_t count) throw()
+    T* allocz(std::size_t count) noexcept
       {
-        return m_pool.allocz<T>(count);
+        return proxied.allocz<T>(count);
       }
 
   private:
-    Pool& m_pool;
+    apr::pool& proxied;
   };
 };
 
-/**
- * Pool wrapper that hides the pool implementation, except for construction.
- *
- * Construct this object outside a loop body, then within the body,
- * use Pool::Iteration to access the wrapped pool.
- */
-class IterationPool : detail::noncopyable
-{
-public:
-  IterationPool() {}
-
-  explicit IterationPool(Pool* parent) throw()
-    : m_pool(parent)
-    {}
-
-private:
-  friend class Pool::Iteration;
-  Pool m_pool;
-};
-
-// Pool::Iteration constructor implementation
-inline Pool::Iteration::Iteration(IterationPool& iterbase) throw()
-  : m_pool(iterbase.m_pool)
-{
-  m_pool.clear();
-}
-
 } // namespace apr
 } // namespace svnxx
 } // namespace subversion

Modified: subversion/trunk/subversion/bindings/cxx/src/exception.cpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/src/exception.cpp?rev=1849722&r1=1849721&r2=1849722&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/src/exception.cpp (original)
+++ subversion/trunk/subversion/bindings/cxx/src/exception.cpp Tue Dec 25 
20:34:51 2018
@@ -169,7 +169,7 @@ int Error::code() const throw()
 
 namespace {
 const char* get_generic_message(apr_status_t error_code,
-                                const APR::Pool& scratch_pool)
+                                const apr::pool& scratch_pool)
 {
   char errorbuf[512];
 
@@ -195,7 +195,7 @@ const char* get_generic_message(apr_stat
 
 void handle_one_error(Error::MessageList& ml, bool show_traces,
                       const detail::ErrorDescription* descr,
-                      const APR::Pool& pool)
+                      const apr::pool& result_pool)
 {
   const int error_code = descr->code();
 
@@ -203,7 +203,7 @@ void handle_one_error(Error::MessageList
     {
       const char* file_utf8 = NULL;
       svn_error_t* err =
-        svn_utf_cstring_to_utf8(&file_utf8, descr->file(), pool.get());
+        svn_utf_cstring_to_utf8(&file_utf8, descr->file(), result_pool.get());
       if (err)
         {
           svn_error_clear(err);
@@ -233,7 +233,7 @@ void handle_one_error(Error::MessageList
 
   const char *description = descr->what();
   if (!description)
-    description = get_generic_message(error_code, pool);
+    description = get_generic_message(error_code, result_pool);
   ml.push_back(Error::Message(error_code, std::string(description), false));
 }
 } // anonymous namespace
@@ -258,11 +258,11 @@ Error::MessageList Error::compile_messag
   std::vector<int> empties;
   empties.reserve(max_length);
 
-  APR::IterationPool iterbase;
+  apr::pool iterbase;
   for (const detail::ErrorDescription* description = m_description.get();
        description; description = description->nested().get())
     {
-      APR::Pool::Iteration iterpool(iterbase);
+      apr::pool::iteration iterpool(iterbase);
 
       if (!description->what())
         {
@@ -280,8 +280,8 @@ Error::MessageList Error::compile_messag
 
 const char* Error::Message::generic_message() const
 {
-  APR::Pool pool;
-  return get_generic_message(m_errno, pool);
+  apr::pool scratch_pool;
+  return get_generic_message(m_errno, scratch_pool);
 }
 
 namespace detail {

Modified: 
subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_array_helpers.hpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_array_helpers.hpp?rev=1849722&r1=1849721&r2=1849722&view=diff
==============================================================================
--- 
subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_array_helpers.hpp 
(original)
+++ 
subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_array_helpers.hpp 
Tue Dec 25 20:34:51 2018
@@ -28,7 +28,7 @@
 
 namespace {
 // Create a randomly-ordered array of constant strings.
-apr_array_header_t* fill_array(APR::Pool& pool)
+apr_array_header_t* fill_array(apr::pool& pool)
 {
   apr_array_header_t* a = apr_array_make(pool.get(), 0, sizeof(const char*));
   APR_ARRAY_PUSH(a, const char*) = "primus";

Modified: subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_arrays.cpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_arrays.cpp?rev=1849722&r1=1849721&r2=1849722&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_arrays.cpp 
(original)
+++ subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_arrays.cpp Tue 
Dec 25 20:34:51 2018
@@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE(create_array)
 {
   typedef APR::Array<unsigned char> Array;
 
-  APR::Pool pool;
+  apr::pool pool;
   Array array(pool);
 
   BOOST_TEST(array.array() != nullptr);
@@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE(wrap_array)
 {
   typedef APR::Array<unsigned char> Array;
 
-  APR::Pool pool;
+  apr::pool pool;
   apr_array_header_t* apr_array =
     apr_array_make(pool.get(), 0, sizeof(Array::value_type));
   BOOST_TEST_REQUIRE(apr_array != nullptr);
@@ -65,7 +65,7 @@ BOOST_AUTO_TEST_CASE(rewrap_type_mismatc
   typedef APR::Array<unsigned char> ByteArray;
   typedef APR::Array<int> IntArray;
 
-  APR::Pool pool;
+  apr::pool pool;
   BOOST_CHECK_THROW(ByteArray array(IntArray(pool).array()),
                     std::invalid_argument);
 }
@@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE(out_of_bounds)
 {
   typedef APR::Array<unsigned char> Array;
 
-  APR::Pool pool;
+  apr::pool pool;
   Array array(pool);
 
   BOOST_CHECK_THROW(array.at(-1), std::out_of_range);
@@ -85,7 +85,7 @@ BOOST_AUTO_TEST_CASE(indexing)
 {
   typedef APR::Array<const char*> Array;
 
-  APR::Pool pool;
+  apr::pool pool;
   Array array(fill_array(pool));
 
   BOOST_TEST(array[0] == APR_ARRAY_IDX(array.array(), 0, Array::value_type));
@@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE(checked_indexing)
 {
   typedef APR::Array<const char*> Array;
 
-  APR::Pool pool;
+  apr::pool pool;
   Array array(fill_array(pool));
 
   BOOST_TEST(array.at(0) == APR_ARRAY_IDX(array.array(), 0, 
Array::value_type));
@@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE(iteration)
 {
   typedef APR::Array<const char*> Array;
 
-  APR::Pool pool;
+  apr::pool pool;
   Array array(fill_array(pool));
 
   struct Iteration : public Array::Iteration
@@ -150,7 +150,7 @@ BOOST_AUTO_TEST_CASE(const_iteration)
 {
   typedef APR::Array<const char*> Array;
 
-  APR::Pool pool;
+  apr::pool pool;
   Array array(fill_array(pool));
 
   struct Iteration : public Array::ConstIteration
@@ -179,7 +179,7 @@ BOOST_AUTO_TEST_CASE(push)
 {
   typedef APR::Array<const char*> Array;
 
-  APR::Pool pool;
+  apr::pool pool;
   Array array(fill_array(pool));
 
   const Array::size_type point = array.size();
@@ -201,7 +201,7 @@ BOOST_AUTO_TEST_CASE(pop)
 {
   typedef APR::Array<const char*> Array;
 
-  APR::Pool pool;
+  apr::pool pool;
   Array array(fill_array(pool));
 
   for (Array::size_type i = 0, z = array.size(); i <= z; ++i)

Modified: 
subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_const_arrays.cpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_const_arrays.cpp?rev=1849722&r1=1849721&r2=1849722&view=diff
==============================================================================
--- 
subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_const_arrays.cpp 
(original)
+++ 
subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_const_arrays.cpp 
Tue Dec 25 20:34:51 2018
@@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE(wrap_array)
 {
   typedef APR::ConstArray<unsigned char> Array;
 
-  APR::Pool pool;
+  apr::pool pool;
   const apr_array_header_t* apr_array =
     apr_array_make(pool.get(), 0, sizeof(Array::value_type));
   BOOST_TEST_REQUIRE(apr_array != nullptr);
@@ -52,7 +52,7 @@ BOOST_AUTO_TEST_CASE(rewrap_type_mismatc
   typedef APR::ConstArray<unsigned char> ByteArray;
   typedef APR::Array<int> IntArray;
 
-  APR::Pool pool;
+  apr::pool pool;
   BOOST_CHECK_THROW(ByteArray array(IntArray(pool).array()),
                     std::invalid_argument);
 }
@@ -61,7 +61,7 @@ BOOST_AUTO_TEST_CASE(out_of_bounds)
 {
   typedef APR::ConstArray<unsigned char> Array;
 
-  APR::Pool pool;
+  apr::pool pool;
   Array array = Array(APR::Array<Array::value_type>(pool));
 
   BOOST_CHECK_THROW(array.at(-1), std::out_of_range);
@@ -72,7 +72,7 @@ BOOST_AUTO_TEST_CASE(indexing)
 {
   typedef APR::ConstArray<const char*> Array;
 
-  APR::Pool pool;
+  apr::pool pool;
   Array array(fill_array(pool));
 
   BOOST_TEST(array[0] == APR_ARRAY_IDX(array.array(), 0, Array::value_type));
@@ -85,7 +85,7 @@ BOOST_AUTO_TEST_CASE(checked_indexing)
 {
   typedef APR::ConstArray<const char*> Array;
 
-  APR::Pool pool;
+  apr::pool pool;
   Array array(fill_array(pool));
 
   BOOST_TEST(array.at(0) == APR_ARRAY_IDX(array.array(), 0, 
Array::value_type));
@@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE(iteration)
 {
   typedef APR::ConstArray<const char*> Array;
 
-  APR::Pool pool;
+  apr::pool pool;
   Array array(fill_array(pool));
 
   struct Iteration : public Array::Iteration

Modified: subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_hashes.cpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_hashes.cpp?rev=1849722&r1=1849721&r2=1849722&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_hashes.cpp 
(original)
+++ subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_hashes.cpp Tue 
Dec 25 20:34:51 2018
@@ -35,7 +35,7 @@ BOOST_AUTO_TEST_CASE(string_hash)
 {
   typedef APR::Hash<char, const char> H;
 
-  APR::Pool pool;
+  apr::pool pool;
   H hash(pool);
   hash.set("aa", "a");
   hash.set("bbb", "b");
@@ -53,7 +53,7 @@ BOOST_AUTO_TEST_CASE(fixed_string_hash)
   // of the template actually limits the length of the keys.
   typedef APR::Hash<char, const char, 2> H;
 
-  APR::Pool pool;
+  apr::pool pool;
   H hash(pool);
   hash.set("aa&qux", "a");
   hash.set("bb#foo", "b");
@@ -69,7 +69,7 @@ BOOST_AUTO_TEST_CASE(delete_element)
 {
   typedef APR::Hash<char, const char> H;
 
-  APR::Pool pool;
+  apr::pool pool;
   H hash(pool);
   hash.set("aa", "a");
   hash.set("bbb", "b");
@@ -86,7 +86,7 @@ BOOST_AUTO_TEST_CASE(iterate)
 {
   typedef APR::Hash<char, const char> H;
 
-  APR::Pool pool;
+  apr::pool pool;
   H hash(pool);
   hash.set("aa", "a");
   hash.set("bbb", "b");

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=1849722&r1=1849721&r2=1849722&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_pools.cpp 
(original)
+++ subversion/trunk/subversion/bindings/cxx/tests/test_aprwrap_pools.cpp Tue 
Dec 25 20:34:51 2018
@@ -33,21 +33,21 @@ BOOST_AUTO_TEST_SUITE(aprwrap_pools,
 
 BOOST_AUTO_TEST_CASE(initialize_global_pool)
 {
-  APR::Pool pool;
+  apr::pool pool;
   BOOST_TEST(pool.get() != nullptr);
   BOOST_TEST(apr_pool_parent_get(pool.get()) != nullptr);
 }
 
 BOOST_AUTO_TEST_CASE(create_subpool)
 {
-  APR::Pool pool;
-  APR::Pool subpool(&pool);
+  apr::pool pool;
+  apr::pool subpool(&pool);
   BOOST_TEST(pool.get() == apr_pool_parent_get(subpool.get()));
 }
 
 BOOST_AUTO_TEST_CASE(typed_allocate)
 {
-  APR::Pool pool;
+  apr::pool pool;
   const unsigned char* buffer = pool.alloc<unsigned char>(1);
   BOOST_TEST(buffer != nullptr);
 }
@@ -57,7 +57,7 @@ BOOST_AUTO_TEST_CASE(typed_allocate)
 // values of uninitialized memory.
 BOOST_AUTO_TEST_CASE(typed_allocate_zerofill)
 {
-  APR::Pool pool;
+  apr::pool pool;
   static const std::size_t size = 32757;
   const unsigned char* buffer = pool.allocz<unsigned char>(size);
   BOOST_TEST_REQUIRE(buffer != nullptr);


Reply via email to