[rhmessaging-commits] rhmessaging commits: r2597 - in store/trunk/cpp: lib/jrnl and 1 other directories.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue Oct 7 08:50:53 EDT 2008


Author: kpvdr
Date: 2008-10-07 08:50:53 -0400 (Tue, 07 Oct 2008)
New Revision: 2597

Added:
   store/trunk/cpp/lib/jrnl/lfmgr.cpp
   store/trunk/cpp/lib/jrnl/lfmgr.hpp
   store/trunk/cpp/tests/jrnl/_ut_lfmgr.cpp
Modified:
   store/trunk/cpp/lib/Makefile.am
   store/trunk/cpp/lib/jrnl/jcntl.cpp
   store/trunk/cpp/lib/jrnl/jcntl.hpp
   store/trunk/cpp/tests/jrnl/
   store/trunk/cpp/tests/jrnl/Makefile.am
   store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
Log:
Added new lfmgr (logical id and file id manager) class which is responsible for tracking the mapping of logical ids to file ids, and to insert new files at arbitrary points into the map. A full set of unit tests is also included.

Modified: store/trunk/cpp/lib/Makefile.am
===================================================================
--- store/trunk/cpp/lib/Makefile.am	2008-10-06 23:54:48 UTC (rev 2596)
+++ store/trunk/cpp/lib/Makefile.am	2008-10-07 12:50:53 UTC (rev 2597)
@@ -56,6 +56,7 @@
   jrnl/jinf.cpp                 \
   jrnl/jrec.cpp                 \
   jrnl/lf_map.cpp               \
+  jrnl/lfmgr.cpp                \
   jrnl/pmgr.cpp                 \
   jrnl/rmgr.cpp                 \
   jrnl/rfc.cpp                  \
@@ -87,6 +88,7 @@
   jrnl/jinf.hpp                 \
   jrnl/jrec.hpp                 \
   jrnl/lf_map.hpp               \
+  jrnl/lfmgr.hpp                \
   jrnl/pmgr.hpp                 \
   jrnl/rcvdat.hpp               \
   jrnl/rec_hdr.hpp              \

Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp	2008-10-06 23:54:48 UTC (rev 2596)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp	2008-10-07 12:50:53 UTC (rev 2597)
@@ -65,6 +65,7 @@
     _num_jfiles(0),
     _jfsize_sblks(0),
     _fc_arr(0),
+//    _lfmgr(this),
     _emap(),
     _tmap(),
     _rrfc(),
@@ -476,6 +477,16 @@
         _rmgr.invalidate();
 }
 
+fcntl*
+jcntl::new_fcntl(jcntl* const jcp, const std::size_t lid, const std::size_t fid)
+{
+    if (!jcp) return 0;
+    std::ostringstream oss;
+    oss << jcp->jrnl_dir() << "/" << jcp->base_filename();
+    // TODO: resolve fid/lid in following stmt:
+    return new fcntl(oss.str(), fid, lid, jcp->jfsize_sblks(), 0);
+}
+
 // Protected/Private functions
 
 void

Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp	2008-10-06 23:54:48 UTC (rev 2596)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp	2008-10-07 12:50:53 UTC (rev 2597)
@@ -43,6 +43,7 @@
 #include <deque>
 #include "jrnl/jdir.hpp"
 #include "jrnl/fcntl.hpp"
+#include "jrnl/lfmgr.hpp"
 #include "jrnl/rcvdat.hpp"
 #include "jrnl/rmgr.hpp"
 #include "jrnl/wmgr.hpp"
@@ -131,6 +132,7 @@
         u_int16_t _num_jfiles;      ///< Number of journal files
         u_int32_t _jfsize_sblks;    ///< Journal file size in sblks
         fcntl** _fc_arr;            ///< Array of pointers to data file controllers
+//        lfmgr _lfmgr;               ///< LID-FID manager tracks inserted journal files
         enq_map _emap;              ///< Enqueue map for low water mark management
         txn_map _tmap;              ///< Transaction map open transactions
         rrfc _rrfc;                 ///< Read journal rotating file controller
@@ -632,8 +634,13 @@
         inline virtual void instr_incr_outstanding_aio_cnt() {}
         inline virtual void instr_decr_outstanding_aio_cnt() {}
 
+        /**
+        * /brief Static function for creating new fcntl objects for use with obj_arr.
+        */
+        static fcntl* new_fcntl(jcntl* const jcp, const std::size_t lid, const std::size_t fid);
 
 
+
     protected:
         /**
         * \brief Check status of journal before allowing write operations.

Added: store/trunk/cpp/lib/jrnl/lfmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/lfmgr.cpp	                        (rev 0)
+++ store/trunk/cpp/lib/jrnl/lfmgr.cpp	2008-10-07 12:50:53 UTC (rev 2597)
@@ -0,0 +1,135 @@
+/**
+* \file lfmgr.cpp
+*
+* Red Hat Messaging - Message Journal
+*
+* File containing code for class mrg::journal::lfmgr (non-logging file
+* handle), used for controlling journal log files. See comments in file
+* lfmgr.hpp for details.
+*
+* Copyright 2007, 2008 Red Hat, Inc.
+*
+* This file is part of Red Hat Messaging.
+*
+* Red Hat Messaging is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+* USA
+*
+* The GNU Lesser General Public License is available in the file COPYING.
+*/
+
+#include "jrnl/lfmgr.hpp"
+
+#include <cassert>
+
+namespace mrg
+{
+namespace journal
+{
+
+lfmgr::lfmgr()
+{}
+
+lfmgr::~lfmgr()
+{
+    finalize();
+}
+
+void
+lfmgr::initialize(const std::size_t num_jfiles,
+                  jcntl* const jcp,
+                  fcntl* (new_obj_fn)(jcntl* const jcp, const std::size_t lid, const std::size_t fid))
+{
+    finalize();
+    if (num_jfiles > 0)
+    {
+        _fcntl_arr.reserve(2 * num_jfiles); // reserve some extra for possible add_obj() operations
+        append(jcp, new_obj_fn, num_jfiles);
+    }
+}
+
+void
+lfmgr::initialize(const std::vector<u_int16_t>& fid_list, jcntl* const jcp,
+                  fcntl* (new_obj_fn)(jcntl* const jcp, const std::size_t lid, const std::size_t fid))
+{
+    finalize();
+    if (fid_list.size() > 0)
+    {
+        _fcntl_arr.reserve(2 * fid_list.size()); // reserve some extra for possible add_obj() operations
+        _fcntl_arr.assign(fid_list.size(), 0);
+        std::vector<u_int16_t> lid_list(fid_list.size(), 0);
+        for (std::size_t lid = 0; lid < fid_list.size(); lid++)
+            lid_list[fid_list[lid]] = lid;
+        for (std::size_t fid = 0; fid < lid_list.size(); fid++)
+            _fcntl_arr[lid_list[fid]] = new_obj_fn(jcp, lid_list[fid], fid);
+    }
+}
+
+void
+lfmgr::append(jcntl* const jcp,
+              fcntl* (new_obj_fn)(jcntl* const jcp, const std::size_t lid, const std::size_t fid),
+              const std::size_t num_jfiles)
+{
+    std::size_t s = _fcntl_arr.size();
+    for (std::size_t i = s; i < s + num_jfiles; i++)
+        _fcntl_arr.push_back(new_obj_fn(jcp, i, i));
+}
+
+void
+lfmgr::insert(const std::size_t after_index,
+              jcntl* const jcp,
+              fcntl* (new_obj_fn)(jcntl* const jcp, const std::size_t lid, const std::size_t fid),
+              const std::size_t num_jfiles)
+{
+    assert(after_index < _fcntl_arr.size());
+    std::size_t fid = _fcntl_arr.size();
+    for (std::size_t lid = after_index + 1; lid <= after_index + num_jfiles; lid++, fid++)
+        _fcntl_arr.insert(_fcntl_arr.begin() + lid, new_obj_fn(jcp, lid, fid));
+    for (std::size_t lid = after_index + num_jfiles + 1; lid < _fcntl_arr.size(); lid++)
+    {
+        fcntl* fp = _fcntl_arr[lid];
+        assert(fp != 0);
+        fp->set_lid(fp->lid() + num_jfiles);
+    }
+}
+
+void
+lfmgr::finalize()
+{
+    for (u_int32_t i=0; i<_fcntl_arr.size(); i++)
+        delete _fcntl_arr[i];
+    _fcntl_arr.clear();
+}
+
+// Testing functions
+
+void
+lfmgr::get_fid_list(std::vector<u_int16_t>& fid_list) const
+{
+    fid_list.clear();
+    for (std::size_t i = 0; i < _fcntl_arr.size(); i++)
+        fid_list.push_back(_fcntl_arr[i]->fid());
+}
+
+void
+lfmgr::get_lid_list(std::vector<u_int16_t>& lid_list) const
+{
+    lid_list.clear();
+    lid_list.assign(_fcntl_arr.size(), 0);
+    for (std::size_t i = 0; i < _fcntl_arr.size(); i++)
+        lid_list[_fcntl_arr[i]->fid()] = i;
+}
+
+} // namespace journal
+} // namespace mrg

Added: store/trunk/cpp/lib/jrnl/lfmgr.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/lfmgr.hpp	                        (rev 0)
+++ store/trunk/cpp/lib/jrnl/lfmgr.hpp	2008-10-07 12:50:53 UTC (rev 2597)
@@ -0,0 +1,165 @@
+/**
+* \file lfmgr.hpp
+*
+* Red Hat Messaging - Message Journal
+*
+* Class mrg::journal::lfmgr. See class documentation for details.
+*
+* Copyright 2007, 2008 Red Hat, Inc.
+*
+* This file is part of Red Hat Messaging.
+*
+* Red Hat Messaging is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+* USA
+*
+* The GNU Lesser General Public License is available in the file COPYING.
+*/
+
+#ifndef mrg_journal_lfmgr_hpp
+#define mrg_journal_lfmgr_hpp
+
+namespace mrg
+{
+namespace journal
+{
+    class jcntl;
+    class lfmgr;
+}
+}
+
+#include "jrnl/fcntl.hpp"
+#include <vector>
+
+namespace mrg
+{
+namespace journal
+{
+
+    /**
+    * \brief LID-FID manager. This class maps the logical id (lid) to the physical file id (fid) so that files may be
+    * inserted into the file ring buffer in (nearly) arbitrary logical locations while the physical ids continue to
+    * be appended.
+    */
+    class lfmgr
+    {
+    protected:
+        std::vector<fcntl*> _fcntl_arr; ///< Array of pointers to objects
+
+    public:
+        lfmgr();
+        virtual ~lfmgr();
+
+        /**
+        * \brief Initialize from scratch for a known number of journal files. All lid values are identical to fid
+        * values (which is normal before any inserts have occurred).
+        *
+        * \param num_jfiles Number of files to be created, and consequently the number of fcntl objects in array
+        *                   _fcntl_arr.
+        * \param jcp        Pointer to jcntl instance. This is used to find the file path and base filename so that
+        *                   new files may be created.
+        * \param new_obj_fn Pointer to function which creates and returns a pointer to a new fcntl object (and hence
+        *                   causes a new journal file to be created).
+        */
+        void initialize(const std::size_t num_jfiles,
+                        jcntl* const jcp,
+                        fcntl* (new_obj_fn)(jcntl* const jcp, const std::size_t lid, const std::size_t fid));
+
+        /**
+        * \brief Initialize from a known lid-fid map fid_list, which is usually obtained from a recover. The index of
+        * fid_list is the logical id (lid); the value contained in the vector is the file id (fid).
+        *
+        * \param fid_list   Vector containing fid sequence.
+        * \param jcp        Pointer to jcntl instance. This is used to find the file path and base filename so that
+        *                   new files may be created.
+        * \param new_obj_fn Pointer to function which creates and returns a pointer to a new fcntl object (and hence
+        *                   causes a new journal file to be created).
+        */
+        void initialize(const std::vector<u_int16_t>& fid_list,
+                        jcntl* const jcp,
+                        fcntl* (new_obj_fn)(jcntl* const jcp, const std::size_t lid, const std::size_t fid));
+
+        /**
+        * \brief Append num_jfiles files to the end of the logical and file id sequence. This is similar to extending
+        * the from-scratch initialization.
+        *
+        * \param jcp        Pointer to jcntl instance. This is used to find the file path and base filename so that
+        *                   new files may be created.
+        * \param new_obj_fn Pointer to function which creates and returns a pointer to a new fcntl object (and hence
+        *                   causes a new journal file to be created).
+        * \param num_jfiles The number of files by which to increase.
+        */
+        void append(jcntl* const jcp,
+                    fcntl* (new_obj_fn)(jcntl* const jcp, const std::size_t lid, const std::size_t fid),
+                    const std::size_t num_jfiles = 1);
+
+        /**
+        * \brief Insert num_jfiles files after lid index after_index. This causes all lids after after_index to be
+        * increased by num_jfiles.
+        *
+        * Note that it is not possible to insert <i>before</i> lid 0, and thus lid 0 should always point to fid 0.
+        * Inserting before index 0 is logically equivilent to inserting after the last lid in a circular buffer.
+        *
+        * \param after_index Lid index after which to insert file(s).
+        * \param jcp        Pointer to jcntl instance. This is used to find the file path and base filename so that
+        *                   new files may be created.
+        * \param new_obj_fn Pointer to function which creates and returns a pointer to a new fcntl object (and hence
+        *                   causes a new journal file to be created).
+        * \param num_jfiles The number of files by which to increase.
+        */
+        void insert(const std::size_t after_index,
+                    jcntl* const jcp,
+                    fcntl* (new_obj_fn)(jcntl* const jcp, const std::size_t lid, const std::size_t fid),
+                    const std::size_t num_jfiles = 1);
+
+        /**
+        * \brief Clears _fcntl_arr and deletes all fcntl instances.
+        */
+        void finalize();
+
+        /**
+        * \brief Returns true if initialized; false otherwise. After instantiation, will return false until
+        * either initialize() is called; thereafter true until finalize() is called, whereupon it will
+        * return false again.
+        *
+        * \return True if initialized; False otherwise.
+        */
+        inline bool is_init() const { return _fcntl_arr.size() > 0; }
+
+        /**
+        * \brief Returns the number of journal files, including any that were appended or inserted since initialization.
+        *
+        * \return Number of journal files if initialized; 0 otherwise.
+        */
+        inline std::size_t size() const { return _fcntl_arr.size(); }
+
+        /**
+        * \brief Get a pointer to fcntl instance for a given lid.
+        *
+        * \return Pointer to fcntl object corresponding to logical id lid, or 0 if lid is out of range (greater than
+        * number of files in use).
+        */
+        inline fcntl* get_fcntlp(const u_int16_t lid) const
+                { if (lid >= _fcntl_arr.size()) return 0; return _fcntl_arr[lid]; }
+
+        // Testing functions
+        void get_fid_list(std::vector<u_int16_t>& fid_list) const;
+        void get_lid_list(std::vector<u_int16_t>& lid_list) const;
+
+    };
+
+} // namespace journal
+} // namespace mrg
+
+#endif // ifndef mrg_journal_lfmgr_hpp


Property changes on: store/trunk/cpp/tests/jrnl
___________________________________________________________________
Name: svn:ignore
   - .deps
.libs
Makefile
Makefile.in
jtest
_ut_enq_map
_ut_arr_cnt
_ut_jdir
_ut_jerrno
_ut_jexception
_ut_jinf
_ut_rec_hdr
_ut_time_ns
_ut_txn_map
_st_basic
_st_basic_txn
_st_read
_st_read_txn
.valgrind.supp
.valgrindrc

   + .deps
.libs
Makefile
Makefile.in
jtest
_ut_enq_map
_ut_arr_cnt
_ut_jdir
_ut_jerrno
_ut_jexception
_ut_jinf
_ut_lfmgr
_ut_rec_hdr
_ut_time_ns
_ut_txn_map
_st_basic
_st_basic_txn
_st_read
_st_read_txn
.valgrind.supp
.valgrindrc


Modified: store/trunk/cpp/tests/jrnl/Makefile.am
===================================================================
--- store/trunk/cpp/tests/jrnl/Makefile.am	2008-10-06 23:54:48 UTC (rev 2596)
+++ store/trunk/cpp/tests/jrnl/Makefile.am	2008-10-07 12:50:53 UTC (rev 2597)
@@ -51,6 +51,7 @@
   _ut_jinf \
   _ut_enq_map \
   _ut_txn_map \
+  _ut_lfmgr \
   _st_basic \
   _st_basic_txn \
   _st_read \
@@ -68,6 +69,7 @@
   _ut_jdir \
   _ut_enq_map \
   _ut_txn_map \
+  _ut_lfmgr \
   _st_basic \
   _st_basic_txn \
   _st_read \
@@ -103,6 +105,9 @@
 _ut_txn_map_SOURCES = _ut_txn_map.cpp $(UNIT_TEST_SRCS)
 _ut_txn_map_LDADD = $(UNIT_TEST_LDADD) -lrt
 
+_ut_lfmgr_SOURCES = _ut_lfmgr.cpp $(UNIT_TEST_SRCS)
+_ut_lfmgr_LDADD = $(UNIT_TEST_LDADD) -lrt
+
 _st_basic_SOURCES = _st_basic.cpp _st_helper_fns.hpp $(UNIT_TEST_SRCS)
 _st_basic_LDADD = $(UNIT_TEST_LDADD) -lrt
 

Modified: store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp	2008-10-06 23:54:48 UTC (rev 2596)
+++ store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp	2008-10-07 12:50:53 UTC (rev 2597)
@@ -29,6 +29,7 @@
 // definition.
 
 #include <cstdlib>
+#include <time.h>
 
 #define MAX_AIO_SLEEPS 500
 #define AIO_SLEEP_TIME 1000
@@ -334,7 +335,7 @@
     return u_int32_t(::ceil(num_files * file_size_sblks * (1 - (1.0 * JRNL_ENQ_THRESHOLD / 100))));
 }
 
-const string&
+string&
 create_msg(string& s, const int msg_num, const int len)
 {
     ostringstream oss;
@@ -345,7 +346,7 @@
     return s;
 }
 
-const string&
+string&
 create_xid(string& s, const int msg_num, const int len)
 {
     ostringstream oss;
@@ -355,3 +356,13 @@
     s.assign(oss.str());
     return s;
 }
+
+long
+get_seed()
+{
+    timespec ts;
+    if (::clock_gettime(CLOCK_REALTIME, &ts))
+        BOOST_FAIL("Unable to read clock to generate seed.");
+    long tenths = ts.tv_nsec / 100000000;
+    return long(10 * ts.tv_sec + tenths); // time in tenths of a second
+}

Added: store/trunk/cpp/tests/jrnl/_ut_lfmgr.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_lfmgr.cpp	                        (rev 0)
+++ store/trunk/cpp/tests/jrnl/_ut_lfmgr.cpp	2008-10-07 12:50:53 UTC (rev 2597)
@@ -0,0 +1,663 @@
+/**
+* \file _ut_lfmgr.cpp
+*
+* Red Hat Messaging - Message Journal
+*
+* This file contains the unit tests for the journal.
+*
+* Copyright 2007, 2008 Red Hat, Inc.
+*
+* This file is part of Red Hat Messaging.
+*
+* Red Hat Messaging is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+* USA
+*
+* The GNU Lesser General Public License is available in the file COPYING.
+*/
+
+#include "../unit_test.h"
+#include <cmath>
+#include <iostream>
+#include "jrnl/jcntl.hpp"
+#include "jrnl/lfmgr.hpp"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(arr_cnt_suite)
+
+const string test_filename("_ut_lfmgr");
+
+#include "_st_helper_fns.hpp"
+
+// Helper functions and definitions
+
+typedef vector<u_int16_t> flist;
+typedef flist::const_iterator flist_citr;
+typedef pair<u_int16_t, u_int16_t> flpair;
+typedef map<u_int16_t, u_int16_t> flmap;
+typedef flmap::iterator flmap_itr;
+typedef flmap::const_iterator flmap_citr;
+
+void
+load_vector(const u_int16_t a[], const size_t n, flist& v)
+{
+    for (size_t i = 0; i < n; i++)
+        v.push_back(a[i]);
+}
+
+void
+vectors_equal(const lfmgr& lm, const u_int16_t a[], const size_t n, const flist& b, const bool fid_check)
+{
+    BOOST_CHECK_EQUAL(n, b.size());
+    for (size_t i = 0; i < n; i++)
+    {
+        BOOST_CHECK_EQUAL(a[i], b[i]);
+        fcntl* fp = lm.get_fcntlp(i);
+        BOOST_CHECK(fp != (void*)0);
+        if (fp) BOOST_CHECK_EQUAL(fid_check ? fp->fid() : fp->lid(), fid_check ? a[i] : i);
+    }
+}
+
+void
+vectors_equal(const lfmgr& lm, const flist& a, const flist& b, const bool fid_check)
+{
+    BOOST_CHECK_EQUAL(a.size(), b.size());
+    for (size_t i = 0; i < a.size(); i++)
+    {
+        BOOST_CHECK_EQUAL(a[i], b[i]);
+        fcntl* fp = lm.get_fcntlp(i);
+        BOOST_CHECK(fp != (void*)0);
+        if (fp) BOOST_CHECK_EQUAL(fid_check ? fp->fid() : fp->lid(), fid_check ? a[i] : i);
+    }
+}
+
+void
+linear_vectors_equal(const lfmgr& lm, const size_t n, const flist& f, const bool fid_check)
+{
+    BOOST_CHECK_EQUAL(n, f.size());
+    for (size_t i = 0; i < n; i++)
+    {
+        BOOST_CHECK_EQUAL(i, f[i]);
+        fcntl* fp = lm.get_fcntlp(i);
+        BOOST_CHECK(fp != (void*)0);
+        if (fp) BOOST_CHECK_EQUAL(fid_check ? fp->fid() : fp->lid(), i);
+    }
+}
+
+void
+linear_vectors_equal(const lfmgr& lm, const flist& f, const bool fid_check)
+{
+    for (size_t i = 0; i < f.size(); i++)
+    {
+        BOOST_CHECK_EQUAL(i, f[i]);
+        fcntl* fp = lm.get_fcntlp(i);
+        BOOST_CHECK(fp != (void*)0);
+        if (fp) BOOST_CHECK_EQUAL(fid_check ? fp->fid() : fp->lid(), i);
+    }
+}
+
+void
+check_fids_lids(const lfmgr& lm, const u_int16_t fids[], const u_int16_t lids[], const size_t fid_lid_size)
+{
+    vector<u_int16_t> res;
+    lm.get_fid_list(res);
+    vectors_equal(lm, fids, fid_lid_size, res, true);
+    lm.get_lid_list(res);
+    vectors_equal(lm, lids, fid_lid_size, res, false);
+}
+
+void
+check_fids_lids(const lfmgr& lm, const flist& fids, const flist lids)
+{
+    vector<u_int16_t> res;
+    lm.get_fid_list(res);
+    vectors_equal(lm, fids, res, true);
+    lm.get_lid_list(res);
+    vectors_equal(lm, lids, res, false);
+}
+
+void
+check_linear_fids_lids(const lfmgr& lm, const size_t fid_lid_size)
+{
+    vector<u_int16_t> res;
+    lm.get_fid_list(res);
+    linear_vectors_equal(lm, fid_lid_size, res, true);
+    lm.get_lid_list(res);
+    linear_vectors_equal(lm, fid_lid_size, res, false);
+}
+
+void
+map_init(flmap& m, const u_int16_t num_jfiles)
+{
+    m.clear();
+    for (u_int16_t i=0; i<num_jfiles; i++)
+        m.insert(flpair(i, i));
+}
+
+void
+map_recover(flmap& m, const flist& f)
+{
+    m.clear();
+    u_int16_t l = 0;
+    for (flist_citr i=f.begin(); i<f.end(); i++, l++)
+        m.insert(flpair(l, *i));
+}
+
+void
+map_insert(flmap& m, u_int16_t after_lid, u_int16_t num_jfiles)
+{
+    for (u_int16_t l = m.size() - 1; l > after_lid; l--)
+    {
+        flmap_itr i = m.find(l);
+        u_int16_t f = i->second;
+        m.erase(i);
+        m.insert(flpair(l + num_jfiles, f));
+    }
+    u_int16_t fid = m.size();
+    for (u_int16_t l = after_lid + 1; l <= after_lid + num_jfiles; l++, fid++)
+        m.insert(flpair(l, fid));
+}
+
+void
+map_get_fids(flmap& m, flist& f)
+{
+    f.clear();
+    for (flmap_citr i = m.begin(); i != m.end(); i++)
+        f.push_back(i->second);
+}
+
+void
+map_get_lids(flmap& m, flist& l)
+{
+    l.clear();
+    l.assign(m.size(), 0);
+    for (flmap_citr i = m.begin(); i != m.end(); i++)
+        l[i->second] = i->first;
+}
+
+void
+map_finalize(flmap& m)
+{
+    m.clear();
+}
+
+string
+list_to_string(const flist& f)
+{
+    ostringstream oss;
+    oss << "[";
+    for (flist_citr i = f.begin(); i < f.end(); i++)
+    {
+        if (i != f.begin())
+            oss << ", ";
+        oss << *i;
+    }
+    oss << "]";
+    return oss.str();
+}
+
+// Tests
+
+QPID_AUTO_TEST_CASE(default_constructor)
+{
+    string test_name = get_test_name(test_filename, "default_constructor");
+    /*
+    * Check that after construction, the fid array _fcntl_arr is empty and the is_init() function returns false.
+    */
+    try
+    {
+        lfmgr lm;
+        BOOST_CHECK_EQUAL(lm.is_init(), false);
+        BOOST_CHECK_EQUAL(lm.size(), 0);
+        BOOST_CHECK_EQUAL(lm.get_fcntlp(0), (void*)0);
+    }
+    catch(const exception& e) { BOOST_FAIL(e.what()); }
+    cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(initialize)
+{
+    string test_name = get_test_name(test_filename, "initialize");
+    /*
+    * Check that initialize(std::size_t num_jfiles, ...) correctly creates an ordered fid array _fcntl_arr.
+    */
+    u_int16_t num_jfiles = 8;
+    try
+    {
+        test_jrnl jc(test_name, test_dir, test_name);
+        lfmgr lm;
+        lm.initialize(num_jfiles, &jc, &jc.new_fcntl);
+        BOOST_CHECK_EQUAL(lm.is_init(), true);
+        check_linear_fids_lids(lm, num_jfiles);
+    }
+    catch(const exception& e) { BOOST_FAIL(e.what()); }
+    cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(recover)
+{
+    string test_name = get_test_name(test_filename, "recover");
+    /*
+    * Check that recover - initialize(const std::vector<u_int16_t>& pi_list, ...) - which uses an fid list to specify
+    * the correct order, correctly sets up the specified fid list order.
+    */
+    u_int16_t num_jfiles = 8;
+    u_int16_t fids[] = {0, 4, 1, 5, 6, 2, 3, 7};
+    u_int16_t lids[] = {0, 2, 5, 6, 1, 3, 4, 7};
+    vector<u_int16_t> fid_arr;
+    load_vector(fids, num_jfiles, fid_arr);
+    try
+    {
+        test_jrnl jc(test_name, test_dir, test_name);
+        lfmgr lm;
+        lm.initialize(fid_arr, &jc, &jc.new_fcntl);
+        BOOST_CHECK_EQUAL(lm.is_init(), true);
+        check_fids_lids(lm, fids, lids, num_jfiles);
+    }
+    catch(const exception& e) { BOOST_FAIL(e.what()); }
+    cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(initialize_finalize)
+{
+    string test_name = get_test_name(test_filename, "initialize_finalize");
+    /*
+    * Check that finalize() after an initialize empties _fcntl_arr and that afterwards is_init() returns false.
+    */
+    u_int16_t num_jfiles = 8;
+    try
+    {
+        test_jrnl jc(test_name, test_dir, test_name);
+        lfmgr lm;
+        lm.initialize(num_jfiles, &jc, &jc.new_fcntl);
+        lm.finalize();
+        BOOST_CHECK_EQUAL(lm.is_init(), false);
+        BOOST_CHECK_EQUAL(lm.size(), 0);
+        BOOST_CHECK_EQUAL(lm.get_fcntlp(0), (void*)0);
+        vector<u_int16_t> res;
+        lm.get_fid_list(res);
+        BOOST_CHECK_EQUAL(res.size(), 0);
+        lm.get_lid_list(res);
+        BOOST_CHECK_EQUAL(res.size(), 0);
+    }
+    catch(const exception& e) { BOOST_FAIL(e.what()); }
+    cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(recover_finalize)
+{
+    string test_name = get_test_name(test_filename, "recover_finalize");
+    /*
+    * Check that finalize() after a recover empties _fcntl_arr and that afterwards is_init() returns false.
+    */
+    u_int16_t num_jfiles = 8;
+    u_int16_t fids[] = {0, 4, 1, 5, 6, 2, 3, 7};
+    vector<u_int16_t> fid_arr;
+    load_vector(fids, num_jfiles, fid_arr);
+    try
+    {
+        test_jrnl jc(test_name, test_dir, test_name);
+        lfmgr lm;
+        lm.initialize(fid_arr, &jc, &jc.new_fcntl);
+        lm.finalize();
+        BOOST_CHECK_EQUAL(lm.is_init(), false);
+        BOOST_CHECK_EQUAL(lm.size(), 0);
+        BOOST_CHECK_EQUAL(lm.get_fcntlp(0), (void*)0);
+        vector<u_int16_t> res;
+        lm.get_fid_list(res);
+        BOOST_CHECK_EQUAL(res.size(), 0);
+        lm.get_lid_list(res);
+        BOOST_CHECK_EQUAL(res.size(), 0);
+    }
+    catch(const exception& e) { BOOST_FAIL(e.what()); }
+    cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(initialize_finalize_initialize)
+{
+    string test_name = get_test_name(test_filename, "initialize_finalize_initialize");
+    /*
+    * Check that initialize(std::size_t num_jfiles, ...) correctly creates an ordered fid array _fcntl_arr after it has
+    * been cleared using finialize().
+    */
+    u_int16_t num_jfiles0 = 8;
+    u_int16_t num_jfiles1 = 12;
+    try
+    {
+        test_jrnl jc(test_name, test_dir, test_name);
+        lfmgr lm;
+        lm.initialize(num_jfiles0, &jc, &jc.new_fcntl);
+        BOOST_CHECK_EQUAL(lm.is_init(), true);
+        check_linear_fids_lids(lm, num_jfiles0);
+        lm.finalize();
+        BOOST_CHECK_EQUAL(lm.is_init(), false);
+        lm.initialize(num_jfiles1, &jc, &jc.new_fcntl);
+        BOOST_CHECK_EQUAL(lm.is_init(), true);
+        check_linear_fids_lids(lm, num_jfiles1);
+    }
+    catch(const exception& e) { BOOST_FAIL(e.what()); }
+    cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(recover_finalize_recover)
+{
+    string test_name = get_test_name(test_filename, "recover_finalize_recover");
+    /*
+    * Check that a second call to initialize(const std::vector<u_int16_t>& pi_list, ...) without calling finilize()
+    * correctly clears the first initialize and creates an fid array of specified order and correct size.
+    */
+    u_int16_t num_jfiles0 = 8;
+    u_int16_t fids0[] = {0, 4, 1, 5, 6, 2, 3, 7};
+    u_int16_t lids0[] = {0, 2, 5, 6, 1, 3, 4, 7};
+    u_int16_t fids1[] = {0, 4, 1, 5, 8, 6, 2, 3, 7, 9, 10, 11};
+    u_int16_t lids1[] = {0, 2, 6, 7, 1, 3, 5, 8, 4, 9, 10, 11};
+    vector<u_int16_t> fid_arr0;
+    load_vector(fids0, num_jfiles0, fid_arr0);
+    u_int16_t num_jfiles1 = 12;
+    vector<u_int16_t> fid_arr1;
+    load_vector(fids1, num_jfiles1, fid_arr1);
+    try
+    {
+        test_jrnl jc(test_name, test_dir, test_name);
+        lfmgr lm;
+        lm.initialize(fid_arr0, &jc, &jc.new_fcntl);
+        BOOST_CHECK_EQUAL(lm.is_init(), true);
+        check_fids_lids(lm, fids0, lids0, num_jfiles0);
+        lm.finalize();
+        BOOST_CHECK_EQUAL(lm.is_init(), false);
+        lm.initialize(fid_arr1, &jc, &jc.new_fcntl);
+        BOOST_CHECK_EQUAL(lm.is_init(), true);
+        check_fids_lids(lm, fids1, lids1, num_jfiles1);
+    }
+    catch(const exception& e) { BOOST_FAIL(e.what()); }
+    cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(initialize_initialize)
+{
+    string test_name = get_test_name(test_filename, "initialize_initialize");
+    /*
+    * Check that a second call to initialize(std::size_t num_jfiles, ...) without calling finilize() correctly clears
+    * the first initialize and creates an ordered fid array of the correct size _fcntl_arr.
+    */
+    u_int16_t num_jfiles0 = 8;
+    u_int16_t num_jfiles1 = 12;
+    try
+    {
+        test_jrnl jc(test_name, test_dir, test_name);
+        lfmgr lm;
+        lm.initialize(num_jfiles0, &jc, &jc.new_fcntl);
+        BOOST_CHECK_EQUAL(lm.is_init(), true);
+        check_linear_fids_lids(lm, num_jfiles0);
+        lm.initialize(num_jfiles1, &jc, &jc.new_fcntl);
+        BOOST_CHECK_EQUAL(lm.is_init(), true);
+        check_linear_fids_lids(lm, num_jfiles1);
+    }
+    catch(const exception& e) { BOOST_FAIL(e.what()); }
+    cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(recover_recover)
+{
+    string test_name = get_test_name(test_filename, "recover_recover");
+    /*
+    * Check that a second call to initialize(const std::vector<u_int16_t>& pi_list, ...) without calling finilize()
+    * correctly clears the first recover and creates an ordered fid array of the correct size _fcntl_arr.
+    */
+    u_int16_t num_jfiles0 = 8;
+    u_int16_t fids0[] = {0, 4, 1, 5, 6, 2, 3, 7};
+    u_int16_t lids0[] = {0, 2, 5, 6, 1, 3, 4, 7};
+    u_int16_t fids1[] = {0, 4, 1, 5, 8, 6, 2, 3, 7, 9, 10, 11};
+    u_int16_t lids1[] = {0, 2, 6, 7, 1, 3, 5, 8, 4, 9, 10, 11};
+    vector<u_int16_t> fid_arr0;
+    load_vector(fids0, num_jfiles0, fid_arr0);
+    u_int16_t num_jfiles1 = 12;
+    vector<u_int16_t> fid_arr1;
+    load_vector(fids1, num_jfiles1, fid_arr1);
+    try
+    {
+        test_jrnl jc(test_name, test_dir, test_name);
+        lfmgr lm;
+        lm.initialize(fid_arr0, &jc, &jc.new_fcntl);
+        BOOST_CHECK_EQUAL(lm.is_init(), true);
+        check_fids_lids(lm, fids0, lids0, num_jfiles0);
+        lm.initialize(fid_arr1, &jc, &jc.new_fcntl);
+        BOOST_CHECK_EQUAL(lm.is_init(), true);
+        check_fids_lids(lm, fids1, lids1, num_jfiles1);
+    }
+    catch(const exception& e) { BOOST_FAIL(e.what()); }
+    cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(initialize_append)
+{
+    string test_name = get_test_name(test_filename, "initialize_append");
+    /*
+    * Check that append correctly adds to the end of the array _fcntl_arr.
+    */
+    u_int16_t num_jfiles = 8;
+    u_int16_t num_append_jfiles = 3;
+    try
+    {
+        test_jrnl jc(test_name, test_dir, test_name);
+        lfmgr lm;
+        lm.initialize(num_jfiles, &jc, &jc.new_fcntl);
+        check_linear_fids_lids(lm, num_jfiles);
+
+        // Append single file
+        lm.append(&jc, &jc.new_fcntl);
+        check_linear_fids_lids(lm, num_jfiles + 1);
+
+        // Append 3 more files
+        lm.append(&jc, &jc.new_fcntl, num_append_jfiles);
+        check_linear_fids_lids(lm, num_jfiles + 1 + num_append_jfiles);
+    }
+    catch(const exception& e) { BOOST_FAIL(e.what()); }
+    cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(recover_append)
+{
+    string test_name = get_test_name(test_filename, "recover_append");
+    /*
+    * Check that after a recover, append correctly adds to the end of the array _fcntl_arr.
+    */
+    u_int16_t num_jfiles = 8;
+    u_int16_t fids0[] = {0, 4, 1, 5, 6, 2, 3, 7};
+    u_int16_t lids0[] = {0, 2, 5, 6, 1, 3, 4, 7};
+    u_int16_t fids1[] = {0, 4, 1, 5, 6, 2, 3, 7, 8};
+    u_int16_t lids1[] = {0, 2, 5, 6, 1, 3, 4, 7, 8};
+    u_int16_t fids2[] = {0, 4, 1, 5, 6, 2, 3, 7, 8, 9, 10, 11};
+    u_int16_t lids2[] = {0, 2, 5, 6, 1, 3, 4, 7, 8, 9, 10, 11};
+    vector<u_int16_t> fid_arr;
+    load_vector(fids0, num_jfiles, fid_arr);
+    u_int16_t num_append_jfiles = 3;
+    try
+    {
+        test_jrnl jc(test_name, test_dir, test_name);
+        lfmgr lm;
+        lm.initialize(fid_arr, &jc, &jc.new_fcntl);
+        check_fids_lids(lm, fids0, lids0, num_jfiles);
+
+        // Append single file
+        lm.append(&jc, &jc.new_fcntl);
+        check_fids_lids(lm, fids1, lids1, num_jfiles + 1);
+
+        // Append 3 more files
+        lm.append(&jc, &jc.new_fcntl, num_append_jfiles);
+        check_fids_lids(lm, fids2, lids2, num_jfiles + 1 + num_append_jfiles);
+    }
+    catch(const exception& e) { BOOST_FAIL(e.what()); }
+    cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(initialize_insert)
+{
+    string test_name = get_test_name(test_filename, "initialize_insert");
+    /*
+    * Check that insert works correctly and shifts the fid sequence beyond the insert point correctly.
+    * fids: the sequence of fids as lids are incremented
+    * lids: the sequence of lids as fids are incremented
+    * The following sequence is tested:
+    * initialize 4           fids=[0,1,2,3]           lids=[0,1,2,3]
+    * insert 1 after lid 0   fids=[0,4,1,2,3]         lids=[0,2,3,4,1]
+    * insert 2 after lid 2   fids=[0,4,1,5,6,2,3]     lids=[0,2,5,6,1,3,4]
+    * insert 1 after lid 6   fids=[0,4,1,5,6,2,3,7]   lids=[0,2,5,6,1,3,4,7]
+    * issert 1 after lid 3   fids=[0,4,1,5,8,6,2,3,7] lids=[0,2,6,7,1,3,5,8,4]
+    */
+    u_int16_t num_jfiles = 4;
+    u_int16_t fids1[] = {0, 4, 1, 2, 3};
+    u_int16_t lids1[] = {0, 2, 3, 4, 1};
+    u_int16_t fids2[] = {0, 4, 1, 5, 6, 2, 3};
+    u_int16_t lids2[] = {0, 2, 5, 6, 1, 3, 4};
+    u_int16_t fids3[] = {0, 4, 1, 5, 6, 2, 3, 7};
+    u_int16_t lids3[] = {0, 2, 5, 6, 1, 3, 4, 7};
+    u_int16_t fids4[] = {0, 4, 1, 5, 8, 6, 2, 3, 7};
+    u_int16_t lids4[] = {0, 2, 6, 7, 1, 3, 5, 8, 4};
+    try
+    {
+        test_jrnl jc(test_name, test_dir, test_name);
+        lfmgr lm;
+        lm.initialize(num_jfiles, &jc, &jc.new_fcntl);
+        check_linear_fids_lids(lm, num_jfiles);
+        lm.insert(0, &jc, &jc.new_fcntl);
+        check_fids_lids(lm, fids1, lids1, num_jfiles + 1);
+        lm.insert(2, &jc, &jc.new_fcntl, 2);
+        check_fids_lids(lm, fids2, lids2, num_jfiles + 3);
+        lm.insert(6, &jc, &jc.new_fcntl);
+        check_fids_lids(lm, fids3, lids3, num_jfiles + 4);
+        lm.insert(3, &jc, &jc.new_fcntl);
+        check_fids_lids(lm, fids4, lids4, num_jfiles + 5);
+    }
+    catch(const exception& e) { BOOST_FAIL(e.what()); }
+    cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(recover_insert)
+{
+    string test_name = get_test_name(test_filename, "recover_insert");
+    /*
+    * Check that insert works correctly after a recover and shifts the fid sequence beyond the insert point correctly.
+    * fids: the sequence of fids as lids are incremented
+    * lids: the sequence of lids as fids are incremented
+    * The following sequence is tested:
+    * recover 4              fids=[0,2,3,1]           lids=[0,3,1,2]
+    * insert 1 after lid 0   fids=[0,4,2,3,1]         lids=[0,4,2,3,1]
+    * insert 2 after lid 2   fids=[0,4,2,5,6,3,1]     lids=[0,6,2,5,1,3,4]
+    * insert 1 after lid 6   fids=[0,4,2,5,6,3,1,7]   lids=[0,6,2,5,1,3,4,7]
+    * issert 1 after lid 3   fids=[0,4,2,5,8,6,3,1,7] lids=[0,7,2,6,1,3,5,8,4]
+    */
+    u_int16_t num_jfiles = 4;
+    u_int16_t fids0[] = {0, 2, 3, 1};
+    u_int16_t lids0[] = {0, 3, 1, 2};
+    u_int16_t fids1[] = {0, 4, 2, 3, 1};
+    u_int16_t lids1[] = {0, 4, 2, 3, 1};
+    u_int16_t fids2[] = {0, 4, 2, 5, 6, 3, 1};
+    u_int16_t lids2[] = {0, 6, 2, 5, 1, 3, 4};
+    u_int16_t fids3[] = {0, 4, 2, 5, 6, 3, 1, 7};
+    u_int16_t lids3[] = {0, 6, 2, 5, 1, 3, 4, 7};
+    u_int16_t fids4[] = {0, 4, 2, 5, 8, 6, 3, 1, 7};
+    u_int16_t lids4[] = {0, 7, 2, 6, 1, 3, 5, 8, 4};
+    vector<u_int16_t> fid_arr;
+    load_vector(fids0, num_jfiles, fid_arr);
+    try
+    {
+        test_jrnl jc(test_name, test_dir, test_name);
+        lfmgr lm;
+        lm.initialize(fid_arr, &jc, &jc.new_fcntl); // recover
+        check_fids_lids(lm, fids0, lids0, num_jfiles);
+        lm.insert(0, &jc, &jc.new_fcntl);
+        check_fids_lids(lm, fids1, lids1, num_jfiles + 1);
+        lm.insert(2, &jc, &jc.new_fcntl, 2);
+        check_fids_lids(lm, fids2, lids2, num_jfiles + 3);
+        lm.insert(6, &jc, &jc.new_fcntl);
+        check_fids_lids(lm, fids3, lids3, num_jfiles + 4);
+        lm.insert(3, &jc, &jc.new_fcntl);
+        check_fids_lids(lm, fids4, lids4, num_jfiles + 5);
+    }
+    catch(const exception& e) { BOOST_FAIL(e.what()); }
+    cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(random_tests)
+{
+    string test_name = get_test_name(test_filename, "random_tests");
+    /*
+    * Tests random combinations of initialization/recovery, initial size, number, size and location of inserts.
+    *
+    * To reproduce a specific test, comment out the get_seed() statement and uncomment the literal below, adjusting
+    * the seed value to that required.
+    */
+    const long seed = get_seed();
+    // const long seed = 0x2d928521f;
+    cout << "seed=0x" << hex << seed << dec << " " << flush;
+    ::srand48(seed);
+
+    flmap m;
+    flist f;
+    flist fids;
+    flist lids;
+    
+    for (int test_num = 0; test_num < 100; test_num++)
+    {
+        test_jrnl jc(test_name, test_dir, test_name);
+        lfmgr lm;
+
+        const bool recover_flag = test_num > 0 ? 2.0 * ::drand48() < 1.0 : false; // 50% chance except first run
+        if (recover_flag)
+        {
+            // Recover from previous iteration
+            lm.initialize(f, &jc, &jc.new_fcntl);
+            map_recover(m, f);
+            map_get_fids(m, fids);
+            map_get_lids(m, lids);
+            check_fids_lids(lm, fids, lids);
+        }
+        else
+        {
+            // Initialize from scratch
+            const u_int16_t num_jfiles = 4 + u_int16_t(96.0 * ::drand48()); // size: 4 - 100
+            lm.initialize(num_jfiles, &jc, &jc.new_fcntl);
+            map_init(m, num_jfiles);
+            check_linear_fids_lids(lm, num_jfiles);
+        }
+
+        // Loop to insert fids
+        const int num_inserts = 1 + int(m.size()/5.0 * ::drand48());
+        for (int i = 0; i < num_inserts; i++)
+        {
+            const u_int16_t size = lm.size();
+            const u_int16_t after_lid = u_int16_t(1.0 * size * ::drand48());
+            const u_int16_t num_files = 1 + u_int16_t(4.0 * ::drand48());
+            lm.insert(after_lid, &jc, &jc.new_fcntl, num_files);
+            map_insert(m, after_lid, num_files);
+            map_get_fids(m, fids);
+            map_get_lids(m, lids);
+            check_fids_lids(lm, fids, lids);
+
+            lm.get_fid_list(f);
+        }
+        lm.finalize();
+        map_finalize(m);
+        BOOST_CHECK_EQUAL(lm.is_init(), false);
+        BOOST_CHECK_EQUAL(lm.size(), 0);
+        BOOST_CHECK_EQUAL(lm.get_fcntlp(0), (void*)0);
+    }
+    cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()




More information about the rhmessaging-commits mailing list