[rhmessaging-commits] rhmessaging commits: r1472 - store/trunk/cpp/tests/jrnl.
rhmessaging-commits at lists.jboss.org
rhmessaging-commits at lists.jboss.org
Wed Dec 12 16:33:30 EST 2007
Author: aconway
Date: 2007-12-12 16:33:29 -0500 (Wed, 12 Dec 2007)
New Revision: 1472
Modified:
store/trunk/cpp/tests/jrnl/Makefile.am
store/trunk/cpp/tests/jrnl/unit_test_enq_map.cpp
store/trunk/cpp/tests/jrnl/unit_test_jdir.cpp
store/trunk/cpp/tests/jrnl/unit_test_jerrno.cpp
store/trunk/cpp/tests/jrnl/unit_test_jexception.cpp
store/trunk/cpp/tests/jrnl/unit_test_jinf.cpp
store/trunk/cpp/tests/jrnl/unit_test_rec_hdr.cpp
store/trunk/cpp/tests/jrnl/unit_test_txn_map.cpp
Log:
Fixed tests to work with boost 1.34 as well as 1.33.
Modified: store/trunk/cpp/tests/jrnl/Makefile.am
===================================================================
--- store/trunk/cpp/tests/jrnl/Makefile.am 2007-12-12 20:34:17 UTC (rev 1471)
+++ store/trunk/cpp/tests/jrnl/Makefile.am 2007-12-12 21:33:29 UTC (rev 1472)
@@ -21,7 +21,7 @@
abs_builddir=@abs_builddir@
-AM_CXXFLAGS = $(WARNING_CFLAGS) $(CPPUNIT_CXXFLAGS) $(QPID_CXXFLAGS) -pthread
+AM_CXXFLAGS = $(WARNING_CFLAGS) $(CPPUNIT_CXXFLAGS) $(QPID_CXXFLAGS) -pthread -DBOOST_TEST_DYN_LINK
INCLUDES=-I../../lib
@@ -48,27 +48,30 @@
unit_test_enq_map \
unit_test_txn_map
-unit_test_jexception_SOURCES = unit_test_jexception.cpp
-unit_test_jexception_LDFLAGS = -lboost_unit_test_framework -lbdbstore -L../../lib/.libs
+UNIT_TEST_SRCS=../unit_test.cpp
+UNIT_TEST_LDADD= -lboost_unit_test_framework -lbdbstore -L../../lib/.libs
-unit_test_jerrno_SOURCES = unit_test_jerrno.cpp
-unit_test_jerrno_LDFLAGS = -lboost_unit_test_framework -lbdbstore -L../../lib/.libs
+unit_test_jexception_SOURCES = unit_test_jexception.cpp $(UNIT_TEST_SRCS)
+unit_test_jexception_LDFLAGS = $(UNIT_TEST_LDADD)
-unit_test_rec_hdr_SOURCES = unit_test_rec_hdr.cpp
-unit_test_rec_hdr_LDFLAGS = -lboost_unit_test_framework -lbdbstore -lrt -L../../lib/.libs
+unit_test_jerrno_SOURCES = unit_test_jerrno.cpp $(UNIT_TEST_SRCS)
+unit_test_jerrno_LDADD = $(UNIT_TEST_LDADD)
-unit_test_jinf_SOURCES = unit_test_jinf.cpp
-unit_test_jinf_LDFLAGS = -lboost_unit_test_framework -lbdbstore -lrt -L../../lib/.libs
+unit_test_rec_hdr_SOURCES = unit_test_rec_hdr.cpp $(UNIT_TEST_SRCS)
+unit_test_rec_hdr_LDADD = $(UNIT_TEST_LDADD) -lrt
-unit_test_jdir_SOURCES = unit_test_jdir.cpp
-unit_test_jdir_LDFLAGS = -lboost_unit_test_framework -lbdbstore -lrt -L../../lib/.libs
+unit_test_jinf_SOURCES = unit_test_jinf.cpp $(UNIT_TEST_SRCS)
+unit_test_jinf_LDADD = $(UNIT_TEST_LDADD) -lrt
-unit_test_enq_map_SOURCES = unit_test_enq_map.cpp
-unit_test_enq_map_LDFLAGS = -lboost_unit_test_framework -lbdbstore -lrt -L../../lib/.libs
+unit_test_jdir_SOURCES = unit_test_jdir.cpp $(UNIT_TEST_SRCS)
+unit_test_jdir_LDADD = $(UNIT_TEST_LDADD) -lrt
-unit_test_txn_map_SOURCES = unit_test_txn_map.cpp
-unit_test_txn_map_LDFLAGS = -lboost_unit_test_framework -lbdbstore -lrt -L../../lib/.libs
+unit_test_enq_map_SOURCES = unit_test_enq_map.cpp $(UNIT_TEST_SRCS)
+unit_test_enq_map_LDADD = $(UNIT_TEST_LDADD) -lrt
+unit_test_txn_map_SOURCES = unit_test_txn_map.cpp $(UNIT_TEST_SRCS)
+unit_test_txn_map_LDADD = $(UNIT_TEST_LDADD) -lrt
+
JournalSystemTests_la_SOURCES = \
JournalSystemTests.cpp \
JournalSystemTests.hpp
Modified: store/trunk/cpp/tests/jrnl/unit_test_enq_map.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/unit_test_enq_map.cpp 2007-12-12 20:34:17 UTC (rev 1471)
+++ store/trunk/cpp/tests/jrnl/unit_test_enq_map.cpp 2007-12-12 21:33:29 UTC (rev 1472)
@@ -29,9 +29,7 @@
* The GNU Lesser General Public License is available in the file COPYING.
*/
-#include <boost/test/results_reporter.hpp>
-#include <boost/test/unit_test.hpp>
-#include <boost/test/unit_test_log.hpp>
+#include "../unit_test.h"
#include <iostream>
#include <jrnl/enq_map.hpp>
#include <jrnl/jerrno.hpp>
@@ -39,17 +37,19 @@
using namespace boost::unit_test;
using namespace rhm::journal;
+QPID_AUTO_TEST_SUITE(eng_map_suite)
+
// Test functions of the form
// void fn() {...}
-void test_constructor()
+BOOST_AUTO_TEST_CASE(test_constructor)
{
enq_map e1;
BOOST_CHECK(e1.empty());
BOOST_CHECK_EQUAL(e1.size(), 0);
}
-void test_insert_get()
+BOOST_AUTO_TEST_CASE(test_insert_get)
{
u_int16_t fid;
u_int64_t rid;
@@ -106,7 +106,7 @@
BOOST_CHECK_EQUAL(e2.size(), 0);
}
-void test_get_remove()
+BOOST_AUTO_TEST_CASE(test_get_remove)
{
u_int16_t fid;
u_int64_t rid;
@@ -140,7 +140,7 @@
BOOST_CHECK_EQUAL(e3.size(), 85ULL);
}
-void test_lock()
+BOOST_AUTO_TEST_CASE(test_lock)
{
u_int16_t fid;
u_int64_t rid;
@@ -204,7 +204,7 @@
BOOST_CHECK(e4.empty());
}
-void test_lists()
+BOOST_AUTO_TEST_CASE(test_lists)
{
u_int16_t fid;
u_int64_t rid;
@@ -241,21 +241,4 @@
BOOST_CHECK_EQUAL(fid_list[i], ret_fid_list[i]);
}
-// Initialize test suite and include test functions
-
-test_suite* init_unit_test_suite(int, char**)
-{
- std::cout << "--------" << std::endl << "unit_test_enq_map: ";
- test_suite* ts = BOOST_TEST_SUITE("unit_test_enq_map");
-
- results_reporter::set_level(SHORT_REPORT);
- unit_test_log_t::instance().set_threshold_level(log_messages);
-
- ts->add(BOOST_TEST_CASE(&test_constructor));
- ts->add(BOOST_TEST_CASE(&test_insert_get));
- ts->add(BOOST_TEST_CASE(&test_get_remove));
- ts->add(BOOST_TEST_CASE(&test_lock));
- ts->add(BOOST_TEST_CASE(&test_lists));
-
- return ts;
-}
+QPID_AUTO_TEST_SUITE_END()
Modified: store/trunk/cpp/tests/jrnl/unit_test_jdir.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/unit_test_jdir.cpp 2007-12-12 20:34:17 UTC (rev 1471)
+++ store/trunk/cpp/tests/jrnl/unit_test_jdir.cpp 2007-12-12 21:33:29 UTC (rev 1472)
@@ -29,9 +29,7 @@
* The GNU Lesser General Public License is available in the file COPYING.
*/
-#include <boost/test/results_reporter.hpp>
-#include <boost/test/unit_test.hpp>
-#include <boost/test/unit_test_log.hpp>
+#include "../unit_test.h"
#include <dirent.h>
#include <errno.h>
#include <fstream>
@@ -44,6 +42,8 @@
#include <jrnl/jexception.hpp>
#include <sys/stat.h>
+QPID_AUTO_TEST_SUITE(jdir_suite)
+
#define NUM_JFILES 4
#define JFSIZE_SBLKS 128
@@ -67,7 +67,7 @@
// Test functions of the form
// void fn() {...}
-void test_constructor()
+BOOST_AUTO_TEST_CASE(test_constructor)
{
std::string dir("/tmp/A/B/C/D/E/F");
std::string bfn("test_base");
@@ -76,7 +76,7 @@
BOOST_CHECK(dir1.base_filename().compare(bfn) == 0);
}
-void test_create_delete_dir()
+BOOST_AUTO_TEST_CASE(test_create_delete_dir)
{
// Use instance
std::string dir_A("/tmp/A");
@@ -135,7 +135,7 @@
}
}
-void test_create_delete_dir_recursive()
+BOOST_AUTO_TEST_CASE(test_create_delete_dir_recursive)
{
// Use instances
check_dir_not_existing("/tmp/E");
@@ -201,7 +201,7 @@
BOOST_CHECK(!jdir::exists("/tmp/I"));
}
-void test_clear_verify_dir()
+BOOST_AUTO_TEST_CASE(test_clear_verify_dir)
{
// Use instances
const char* jrnl_dir = "/tmp/test_dir_1";
@@ -389,20 +389,4 @@
BOOST_FAIL("Unable to remove directory " << dirname);
}
-// Initialize test suite and include test functions
-
-test_suite* init_unit_test_suite(int, char**)
-{
- std::cout << "--------" << std::endl << "unit_test_jdir: ";
- test_suite* ts = BOOST_TEST_SUITE("unit_test_jdir");
-
- results_reporter::set_level(SHORT_REPORT);
- unit_test_log_t::instance().set_threshold_level(log_messages);
-
- ts->add(BOOST_TEST_CASE(&test_constructor));
- ts->add(BOOST_TEST_CASE(&test_create_delete_dir));
- ts->add(BOOST_TEST_CASE(&test_create_delete_dir_recursive));
- ts->add(BOOST_TEST_CASE(&test_clear_verify_dir));
-
- return ts;
-}
+QPID_AUTO_TEST_SUITE_END()
Modified: store/trunk/cpp/tests/jrnl/unit_test_jerrno.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/unit_test_jerrno.cpp 2007-12-12 20:34:17 UTC (rev 1471)
+++ store/trunk/cpp/tests/jrnl/unit_test_jerrno.cpp 2007-12-12 21:33:29 UTC (rev 1472)
@@ -29,19 +29,19 @@
* The GNU Lesser General Public License is available in the file COPYING.
*/
-#include <boost/test/results_reporter.hpp>
-#include <boost/test/unit_test.hpp>
-#include <boost/test/unit_test_log.hpp>
+#include "../unit_test.h"
#include <iostream>
#include <jrnl/jerrno.hpp>
+QPID_AUTO_TEST_SUITE(jerrno_suite)
+
using namespace boost::unit_test;
using namespace rhm::journal;
// Test functions of the form
// void fn() {...}
-void test_jerrno()
+BOOST_AUTO_TEST_CASE(test_jerrno)
{
const char* m = "JERR__MALLOC";
std::string malloc_msg = std::string(jerrno::err_msg(jerrno::JERR__MALLOC));
@@ -49,17 +49,4 @@
BOOST_CHECK(::strcmp(jerrno::err_msg(0), "<Unknown error code>") == 0);
}
-// Initialize test suite and include test functions
-
-test_suite* init_unit_test_suite(int, char**)
-{
- std::cout << "--------" << std::endl << "unit_test_jerrno: ";
- test_suite* ts = BOOST_TEST_SUITE("unit_test_jerrno");
-
- results_reporter::set_level(SHORT_REPORT);
- unit_test_log_t::instance().set_threshold_level(log_messages);
-
- ts->add(BOOST_TEST_CASE(&test_jerrno));
-
- return ts;
-}
+QPID_AUTO_TEST_SUITE_END()
Modified: store/trunk/cpp/tests/jrnl/unit_test_jexception.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/unit_test_jexception.cpp 2007-12-12 20:34:17 UTC (rev 1471)
+++ store/trunk/cpp/tests/jrnl/unit_test_jexception.cpp 2007-12-12 21:33:29 UTC (rev 1472)
@@ -29,9 +29,7 @@
* The GNU Lesser General Public License is available in the file COPYING.
*/
-#include <boost/test/results_reporter.hpp>
-#include <boost/test/unit_test.hpp>
-#include <boost/test/unit_test_log.hpp>
+#include "../unit_test.h"
#include <iostream>
#include <jrnl/jerrno.hpp>
#include <jrnl/jexception.hpp>
@@ -39,6 +37,8 @@
using namespace boost::unit_test;
using namespace rhm::journal;
+QPID_AUTO_TEST_SUITE(jexception_suite)
+
// Helper function declarations
void throw_exception(const jexception& e, size_t what_len, size_t ai_len);
void throw_exception(const jexception& e, size_t what_len, size_t tc_len, size_t tf_len);
@@ -48,7 +48,7 @@
// Test functions of the form
// void fn() {...}
-void test_constructor_1()
+BOOST_AUTO_TEST_CASE(test_constructor_1)
{
try
{
@@ -70,7 +70,7 @@
}
}
-void test_constructor_2()
+BOOST_AUTO_TEST_CASE(test_constructor_2)
{
const u_int32_t err_code = 2;
try
@@ -93,7 +93,7 @@
}
}
-void test_constructor_3a()
+BOOST_AUTO_TEST_CASE(test_constructor_3a)
{
const char* err_msg = "exception3";
try
@@ -116,7 +116,7 @@
}
}
-void test_constructor_3b()
+BOOST_AUTO_TEST_CASE(test_constructor_3b)
{
const std::string err_msg("exception3");
try
@@ -139,7 +139,7 @@
}
}
-void test_constructor_4a()
+BOOST_AUTO_TEST_CASE(test_constructor_4a)
{
const u_int32_t err_code = 4;
const char* err_msg = "exception4";
@@ -163,7 +163,7 @@
}
}
-void test_constructor_4b()
+BOOST_AUTO_TEST_CASE(test_constructor_4b)
{
const u_int32_t err_code = 4;
const std::string err_msg("exception4");
@@ -187,7 +187,7 @@
}
}
-void test_constructor_5a()
+BOOST_AUTO_TEST_CASE(test_constructor_5a)
{
const u_int32_t err_code = 5;
const char* err_class = "class5";
@@ -212,7 +212,7 @@
}
}
-void test_constructor_5b()
+BOOST_AUTO_TEST_CASE(test_constructor_5b)
{
const u_int32_t err_code = 5;
const std::string err_class("class5");
@@ -237,7 +237,7 @@
}
}
-void test_constructor_6a()
+BOOST_AUTO_TEST_CASE(test_constructor_6a)
{
const u_int32_t err_code = 6;
const char* err_msg = "exception6";
@@ -263,7 +263,7 @@
}
}
-void test_constructor_6b()
+BOOST_AUTO_TEST_CASE(test_constructor_6b)
{
const u_int32_t err_code = 6;
const std::string err_msg("exception6");
@@ -289,7 +289,7 @@
}
}
-void test_msg_scope()
+BOOST_AUTO_TEST_CASE(test_msg_scope)
{
try
{
@@ -331,28 +331,5 @@
BOOST_CHECK_EQUAL(e.throwing_fn().size(), tf_len);
}
}
-
-// Initialize test suite and include test functions
-test_suite* init_unit_test_suite(int, char**)
-{
- std::cout << "--------" << std::endl << "unit_test_jexception: ";
- test_suite* ts = BOOST_TEST_SUITE("unit_test_jexception");
-
- results_reporter::set_level(SHORT_REPORT);
- unit_test_log_t::instance().set_threshold_level(log_messages);
-
- ts->add(BOOST_TEST_CASE(&test_constructor_1));
- ts->add(BOOST_TEST_CASE(&test_constructor_2));
- ts->add(BOOST_TEST_CASE(&test_constructor_3a));
- ts->add(BOOST_TEST_CASE(&test_constructor_3b));
- ts->add(BOOST_TEST_CASE(&test_constructor_4a));
- ts->add(BOOST_TEST_CASE(&test_constructor_4b));
- ts->add(BOOST_TEST_CASE(&test_constructor_5a));
- ts->add(BOOST_TEST_CASE(&test_constructor_5b));
- ts->add(BOOST_TEST_CASE(&test_constructor_6a));
- ts->add(BOOST_TEST_CASE(&test_constructor_6b));
- ts->add(BOOST_TEST_CASE(&test_msg_scope));
-
- return ts;
-}
+QPID_AUTO_TEST_SUITE_END()
Modified: store/trunk/cpp/tests/jrnl/unit_test_jinf.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/unit_test_jinf.cpp 2007-12-12 20:34:17 UTC (rev 1471)
+++ store/trunk/cpp/tests/jrnl/unit_test_jinf.cpp 2007-12-12 21:33:29 UTC (rev 1472)
@@ -29,9 +29,7 @@
* The GNU Lesser General Public License is available in the file COPYING.
*/
-#include <boost/test/results_reporter.hpp>
-#include <boost/test/unit_test.hpp>
-#include <boost/test/unit_test_log.hpp>
+#include "../unit_test.h"
#include <fstream>
#include <iomanip>
#include <iostream>
@@ -47,6 +45,8 @@
using namespace boost::unit_test;
using namespace rhm::journal;
+QPID_AUTO_TEST_SUITE(jinf_suite)
+
// Helper function declarations
const std::string jid("test journal id");
const std::string jdir("/tmp");
@@ -67,7 +67,7 @@
// Test functions of the form
// void fn() {...}
-void test_write_constructor()
+BOOST_AUTO_TEST_CASE(test_write_constructor)
{
::clock_gettime(CLOCK_REALTIME, &ts);
jinf ji(jid, jdir, base_filename, NUM_JFILES, JFSIZE_SBLKS, ts);
@@ -89,7 +89,7 @@
ji.write();
}
-void test_read_constructor()
+BOOST_AUTO_TEST_CASE(test_read_constructor)
{
std::stringstream fn;
fn << jdir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
@@ -111,7 +111,7 @@
BOOST_CHECK_EQUAL(ji.rmgr_num_pages(), (u_int32_t)JRNL_RMGR_PAGES);
}
-void test_validate()
+BOOST_AUTO_TEST_CASE(test_validate)
{
std::stringstream fn;
fn << jdir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
@@ -119,7 +119,7 @@
// TODO: Check validation picks up conflict, but need to be friend to jinf to do it
}
-void test_analyze_empty_journal()
+BOOST_AUTO_TEST_CASE(test_analyze_empty_journal)
{
std::vector<std::string> jfiles;
create_journal_filenames(jfiles);
@@ -139,7 +139,7 @@
clean_journal_files(jfiles);
}
-void test_analyze_linear_journal()
+BOOST_AUTO_TEST_CASE(test_analyze_linear_journal)
{
std::vector<std::string> jfiles;
for (int i=0; i<NUM_JFILES; i++)
@@ -244,21 +244,4 @@
fh._ts_nsec = ts.tv_nsec;
}
-// Initialize test suite and include test functions
-
-test_suite* init_unit_test_suite(int, char**)
-{
- std::cout << "--------" << std::endl << "unit_test_jinf: ";
- test_suite* ts = BOOST_TEST_SUITE("unit_test_jinf");
-
- results_reporter::set_level(SHORT_REPORT);
- unit_test_log_t::instance().set_threshold_level(log_messages);
-
- ts->add(BOOST_TEST_CASE(&test_write_constructor));
- ts->add(BOOST_TEST_CASE(&test_read_constructor));
- ts->add(BOOST_TEST_CASE(&test_validate));
- ts->add(BOOST_TEST_CASE(&test_analyze_empty_journal));
- ts->add(BOOST_TEST_CASE(&test_analyze_linear_journal));
-
- return ts;
-}
+QPID_AUTO_TEST_SUITE_END()
Modified: store/trunk/cpp/tests/jrnl/unit_test_rec_hdr.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/unit_test_rec_hdr.cpp 2007-12-12 20:34:17 UTC (rev 1471)
+++ store/trunk/cpp/tests/jrnl/unit_test_rec_hdr.cpp 2007-12-12 21:33:29 UTC (rev 1472)
@@ -29,9 +29,7 @@
* The GNU Lesser General Public License is available in the file COPYING.
*/
-#include <boost/test/results_reporter.hpp>
-#include <boost/test/unit_test.hpp>
-#include <boost/test/unit_test_log.hpp>
+#include "../unit_test.h"
#include <iostream>
#include <jrnl/deq_hdr.hpp>
#include <jrnl/enq_hdr.hpp>
@@ -43,10 +41,12 @@
using namespace boost::unit_test;
using namespace rhm::journal;
+QPID_AUTO_TEST_SUITE(rec_hdr_suite)
+
// Test functions of the form
// void fn() {...}
-void test_hdr()
+BOOST_AUTO_TEST_CASE(test_hdr)
{
rec_hdr h1;
BOOST_CHECK_EQUAL(h1._magic, 0UL);
@@ -107,7 +107,7 @@
BOOST_CHECK(!h1.get_owi());
}
-void test_rec_tail()
+BOOST_AUTO_TEST_CASE(test_rec_tail)
{
const u_int32_t magic = 0xfedcba98;
const u_int64_t rid = 0xfedcba9876543210ULL;
@@ -133,7 +133,7 @@
}
}
-void test_file_hdr()
+BOOST_AUTO_TEST_CASE(test_file_hdr)
{
const u_int32_t magic = 0xfedcba98UL;
const u_int8_t version = 0xa5;
@@ -213,7 +213,7 @@
}
}
-void test_enq_hdr()
+BOOST_AUTO_TEST_CASE(test_enq_hdr)
{
const u_int32_t magic = 0xfedcba98UL;
const u_int8_t version = 0xa5;
@@ -320,7 +320,7 @@
}
}
-void test_deq_hdr()
+BOOST_AUTO_TEST_CASE(test_deq_hdr)
{
const u_int32_t magic = 0xfedcba98UL;
const u_int8_t version = 0xa5;
@@ -375,7 +375,7 @@
}
}
-void test_txn_hdr()
+BOOST_AUTO_TEST_CASE(test_txn_hdr)
{
const u_int32_t magic = 0xfedcba98UL;
const u_int8_t version = 0xa5;
@@ -427,22 +427,4 @@
}
}
-// Initialize test suite and include test functions
-
-test_suite* init_unit_test_suite(int, char**)
-{
- std::cout << "--------" << std::endl << "unit_test_rec_hdr: ";
- test_suite* ts = BOOST_TEST_SUITE("unit_test_rec_hdr");
-
- results_reporter::set_level(SHORT_REPORT);
- unit_test_log_t::instance().set_threshold_level(log_messages);
-
- ts->add(BOOST_TEST_CASE(&test_hdr));
- ts->add(BOOST_TEST_CASE(&test_rec_tail));
- ts->add(BOOST_TEST_CASE(&test_file_hdr));
- ts->add(BOOST_TEST_CASE(&test_enq_hdr));
- ts->add(BOOST_TEST_CASE(&test_deq_hdr));
- ts->add(BOOST_TEST_CASE(&test_txn_hdr));
-
- return ts;
-}
+QPID_AUTO_TEST_SUITE_END()
Modified: store/trunk/cpp/tests/jrnl/unit_test_txn_map.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/unit_test_txn_map.cpp 2007-12-12 20:34:17 UTC (rev 1471)
+++ store/trunk/cpp/tests/jrnl/unit_test_txn_map.cpp 2007-12-12 21:33:29 UTC (rev 1472)
@@ -29,9 +29,7 @@
* The GNU Lesser General Public License is available in the file COPYING.
*/
-#include <boost/test/results_reporter.hpp>
-#include <boost/test/unit_test.hpp>
-#include <boost/test/unit_test_log.hpp>
+#include "../unit_test.h"
#include <iostream>
#include <iomanip>
#include <jrnl/txn_map.hpp>
@@ -40,6 +38,8 @@
using namespace boost::unit_test;
using namespace rhm::journal;
+QPID_AUTO_TEST_SUITE(txn_map_suite)
+
// Helper function declarations
const std::string make_xid(u_int64_t rid);
void check_td_equal(txn_data& td1, txn_data& td2);
@@ -47,7 +47,7 @@
// Test functions of the form
// void fn() {...}
-void test_constructor()
+BOOST_AUTO_TEST_CASE(test_constructor)
{
const u_int64_t rid = 0x123456789abcdef0ULL;
const u_int64_t drid = 0xfedcba9876543210ULL;
@@ -65,7 +65,7 @@
BOOST_CHECK_EQUAL(t1.size(), 0);
}
-void test_insert_get()
+BOOST_AUTO_TEST_CASE(test_insert_get)
{
u_int16_t fid;
u_int64_t rid;
@@ -109,18 +109,4 @@
BOOST_CHECK_EQUAL(td1._aio_compl, td2._aio_compl);
}
-// Initialize test suite and include test functions
-
-test_suite* init_unit_test_suite(int, char**)
-{
- std::cout << "--------" << std::endl << "unit_test_txn_map: ";
- test_suite* ts = BOOST_TEST_SUITE("unit_test_txn_map");
-
- results_reporter::set_level(SHORT_REPORT);
- unit_test_log_t::instance().set_threshold_level(log_messages);
-
- ts->add(BOOST_TEST_CASE(&test_constructor));
- ts->add(BOOST_TEST_CASE(&test_insert_get));
-
- return ts;
-}
+QPID_AUTO_TEST_SUITE_END()
More information about the rhmessaging-commits
mailing list