Author: astitcher
Date: 2009-07-23 18:46:20 -0400 (Thu, 23 Jul 2009)
New Revision: 3519
Modified:
store/trunk/cpp/tests/.valgrind.supp
store/trunk/cpp/tests/jrnl/_st_auto_expand.cpp
store/trunk/cpp/tests/jrnl/_st_basic.cpp
store/trunk/cpp/tests/jrnl/_st_basic_txn.cpp
store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
store/trunk/cpp/tests/jrnl/_st_read.cpp
store/trunk/cpp/tests/jrnl/_st_read_txn.cpp
store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp
store/trunk/cpp/tests/jrnl/_ut_rec_hdr.cpp
Log:
Changes to allow the tests to compile/work with gcc 4.4
Modified: store/trunk/cpp/tests/.valgrind.supp
===================================================================
--- store/trunk/cpp/tests/.valgrind.supp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/.valgrind.supp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -24,9 +24,10 @@
}
{
- Bogus epoll_ctl error on i386
- Memcheck:Param
- epoll_ctl(event)
- fun:epoll_ctl
+ Probable use after delete problem in boost::unit_test
+ Memcheck:Addr8
+ fun:_ZN5boost9unit_test14framework_implD1Ev
+ fun:exit
+ fun:(below main)
}
Modified: store/trunk/cpp/tests/jrnl/_st_auto_expand.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_auto_expand.cpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_st_auto_expand.cpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -45,7 +45,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
unsigned m;
@@ -70,7 +71,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
unsigned m;
@@ -107,7 +109,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
unsigned m;
Modified: store/trunk/cpp/tests/jrnl/_st_basic.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_basic.cpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_st_basic.cpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -53,7 +53,8 @@
string test_name = get_test_name(test_filename, "instantiation");
try
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
}
catch(const exception& e) { BOOST_FAIL(e.what()); }
@@ -65,7 +66,8 @@
string test_name = get_test_name(test_filename, "initialization");
try
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
BOOST_CHECK_EQUAL(jc.is_ready(), true);
@@ -81,7 +83,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
BOOST_CHECK_EQUAL(enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false),
u_int64_t(m));
@@ -111,7 +114,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<2*NUM_MSGS; m+=2)
{
@@ -144,7 +148,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
unsigned n = num_msgs_to_full(NUM_TEST_JFILES, TEST_JFSIZE_SBLKS *
JRNL_SBLK_SIZE,
16*MSG_REC_SIZE_DBLKS, true);
@@ -165,7 +170,8 @@
try
{
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
BOOST_CHECK_EQUAL(jc.is_read_only(), false);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
@@ -175,7 +181,8 @@
{
u_int64_t hrid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
BOOST_CHECK_EQUAL(jc.is_read_only(), false);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
@@ -186,7 +193,8 @@
{
u_int64_t hrid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
BOOST_CHECK_EQUAL(jc.is_read_only(), false);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
@@ -210,7 +218,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
@@ -218,7 +227,8 @@
{
u_int64_t hrid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
jc.recover_complete();
@@ -241,7 +251,8 @@
for (int m=0; m<2*NUM_MSGS; m+=2)
{
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
if (m == 0)
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS); // First
time only
else
@@ -253,7 +264,8 @@
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
}
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(m));
jc.recover_complete();
@@ -273,7 +285,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
// Transient msgs - should not recover
for (int m=0; m<NUM_MSGS; m++)
@@ -292,7 +305,8 @@
string msg;
u_int64_t hrid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
// Recover non-transient msgs
for (int m=NUM_MSGS; m<NUM_MSGS*2; m++)
@@ -367,7 +381,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
enq_msg(jc, 0, create_msg(msg, 0, MSG_SIZE), false);
deq_msg(jc, 0, 1);
@@ -398,7 +413,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
unsigned m;
@@ -427,7 +443,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
// 5 cycles of enqueue/dequeue blocks of half threshold exception size
@@ -452,7 +469,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
// 5 cycles of enqueue/dequeue blocks of half threshold exception size
@@ -481,7 +499,8 @@
LARGE_MSG_REC_SIZE_DBLKS)/2;
for (unsigned i=0; i<5; i++)
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
if (i)
{
jc.recover(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS, 0, hrid);
@@ -514,7 +533,8 @@
LARGE_MSG_REC_SIZE_DBLKS)/2;
for (unsigned i=0; i<5; i++)
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
if (i)
{
jc.recover(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS, 0, hrid);
Modified: store/trunk/cpp/tests/jrnl/_st_basic_txn.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_basic_txn.cpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_st_basic_txn.cpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -46,7 +46,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
@@ -67,7 +68,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
@@ -95,7 +97,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
@@ -117,7 +120,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
@@ -144,7 +148,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
@@ -168,7 +173,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
@@ -192,7 +198,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
@@ -215,7 +222,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
Modified: store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -57,33 +57,39 @@
bool done() { if (flag || _wstate == NONE) return true; else { flag = true; return
false; } }
};
-class test_jrnl : public jcntl, public virtual aio_callback
+class test_jrnl_cb : public aio_callback {
+ virtual void wr_aio_cb(std::vector<data_tok*>& dtokl)
+ {
+ for (std::vector<data_tok*>::const_iterator i=dtokl.begin();
i!=dtokl.end(); i++)
+ {
+ test_dtok* dtp = static_cast<test_dtok*>(*i);
+ if (dtp->done())
+ delete dtp;
+ }
+ }
+ virtual void rd_aio_cb(std::vector<u_int16_t>& /*pil*/) {}
+};
+
+class test_jrnl : public jcntl
{
+test_jrnl_cb* cb;
+
public:
- test_jrnl(const std::string& jid, const std::string& jdir, const
std::string& base_filename) :
- jcntl(jid, jdir, base_filename) {}
+ test_jrnl(const std::string& jid, const std::string& jdir, const
std::string& base_filename, test_jrnl_cb& cb0) :
+ jcntl(jid, jdir, base_filename),
+ cb(&cb0) {}
virtual ~test_jrnl() {}
void initialize(const u_int16_t num_jfiles, const bool ae, const u_int16_t
ae_max_jfiles,
const u_int32_t jfsize_sblks)
{
jcntl::initialize(num_jfiles, ae, ae_max_jfiles, jfsize_sblks,
JRNL_WMGR_DEF_PAGES, JRNL_WMGR_DEF_PAGE_SIZE,
- this);
+ cb);
_jdir.create_dir();
}
void recover(const u_int16_t num_jfiles, const bool ae, const u_int16_t
ae_max_jfiles, const u_int32_t jfsize_sblks,
vector<string>* txn_list, u_int64_t& highest_rid)
- { jcntl::recover(num_jfiles, ae, ae_max_jfiles, jfsize_sblks, JRNL_WMGR_DEF_PAGES,
JRNL_WMGR_DEF_PAGE_SIZE, this,
+ { jcntl::recover(num_jfiles, ae, ae_max_jfiles, jfsize_sblks, JRNL_WMGR_DEF_PAGES,
JRNL_WMGR_DEF_PAGE_SIZE, cb,
txn_list, highest_rid); }
- virtual void wr_aio_cb(std::vector<data_tok*>& dtokl)
- {
- for (std::vector<data_tok*>::const_iterator i=dtokl.begin();
i!=dtokl.end(); i++)
- {
- test_dtok* dtp = static_cast<test_dtok*>(*i);
- if (dtp->done())
- delete dtp;
- }
- }
- virtual void rd_aio_cb(std::vector<u_int16_t>& /*pil*/) {}
};
/*
Modified: store/trunk/cpp/tests/jrnl/_st_read.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_read.cpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_st_read.cpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -59,7 +59,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
}
@@ -78,7 +79,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
@@ -111,7 +113,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<500*NUM_MSGS; m+=2)
{
@@ -139,7 +142,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
@@ -152,7 +156,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
jc.recover_complete();
@@ -182,7 +187,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(2*NUM_TEST_JFILES, false, 0, 10*TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS*125; m++)
enq_msg(jc, m, create_msg(msg, m, 16*MSG_SIZE), false);
@@ -195,7 +201,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.recover(2*NUM_TEST_JFILES, false, 0, 10*TEST_JFSIZE_SBLKS, 0, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS*125 - 1));
jc.recover_complete();
@@ -225,7 +232,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
@@ -238,7 +246,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
for (int m=0; m<NUM_MSGS; m++)
@@ -259,7 +268,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
for (int m=0; m<NUM_MSGS; m++)
@@ -301,7 +311,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
unsigned m;
for (m=0; m<2*NUM_MSGS; m+=2)
@@ -329,7 +340,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
unsigned m;
unsigned read_buffer_size_dblks = JRNL_RMGR_PAGES * JRNL_RMGR_PAGE_SIZE *
JRNL_SBLK_SIZE;
@@ -370,7 +382,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(2*NUM_TEST_JFILES, false, 0, 10*TEST_JFSIZE_SBLKS);
for (int i=0; i<10; i++)
{
@@ -406,7 +419,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
unsigned read_buffer_size_dblks = JRNL_RMGR_PAGES * JRNL_RMGR_PAGE_SIZE *
JRNL_SBLK_SIZE;
unsigned n = num_msgs_to_full(1, read_buffer_size_dblks, MSG_REC_SIZE_DBLKS,
true);
Modified: store/trunk/cpp/tests/jrnl/_st_read_txn.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_read_txn.cpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_st_read_txn.cpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -49,7 +49,8 @@
string rxid;
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
@@ -84,7 +85,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
@@ -116,7 +118,8 @@
string rxid;
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
create_xid(xid, 1, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
@@ -143,7 +146,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
@@ -172,7 +176,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
create_xid(xid, 2, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
@@ -199,7 +204,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
@@ -228,7 +234,8 @@
bool externalFlag;
create_xid(xid, 3, XID_SIZE);
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
@@ -256,7 +263,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
@@ -287,7 +295,8 @@
bool externalFlag;
create_xid(xid, 4, XID_SIZE);
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
@@ -323,7 +332,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
Modified: store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -434,7 +434,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
{
lpmgr lm;
lpmgr_test_helper::initialize(lm, jc, num_jfiles, false, 0);
@@ -461,7 +462,8 @@
::srand48(1); // init random gen for repeatable tests when using
lpmgr_test_helper::prepare_recover()
try
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
{
@@ -497,7 +499,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
{
lpmgr lm;
lpmgr_test_helper::initialize(lm, jc, num_jfiles, false, 0);
@@ -528,7 +531,8 @@
::srand48(1); // init random gen for repeatable tests when using
lpmgr_test_helper::prepare_recover()
try
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
{
@@ -566,7 +570,8 @@
const u_int16_t num_jfiles = 8;
try
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
lpmgr lm;
lpmgr_test_helper::initialize(lfm, lm, jc, num_jfiles, true, 0);
@@ -593,7 +598,8 @@
u_int16_t num_jfiles_arr[][2] = {{8, 12}, {4, 7}, {0, 0}}; // end with zeros
try
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
for (unsigned p = 0; p < 8; p++)
{
@@ -624,7 +630,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
lpmgr lm;
lpmgr_test_helper::initialize(lfm, lm, jc, initial_num_jfiles, true, 0);
@@ -656,7 +663,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
lpmgr lm;
lpmgr_test_helper::prepare_recover(lfm, initial_num_jfiles);
@@ -681,7 +689,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
const u_int16_t num_jfiles = 8;
lpmgr lm;
@@ -717,7 +726,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
lpmgr_test_helper::check_limit(lfm, jc, false, 8, 0);
}
@@ -736,7 +746,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
lpmgr_test_helper::check_limit(lfm, jc, true, 8, 32);
}
@@ -755,7 +766,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
lpmgr_test_helper::check_limit(lfm, jc, true, 8, 0);
}
@@ -797,7 +809,8 @@
for (int test_num = 0; test_num < 250; test_num++)
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lpmgr lm;
// 50% chance of recovery except first run and if there is still ae space left
const bool recover_flag = test_num > 0 &&
Modified: store/trunk/cpp/tests/jrnl/_ut_rec_hdr.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_rec_hdr.cpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_ut_rec_hdr.cpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -159,7 +159,7 @@
BOOST_CHECK_EQUAL(fh1._lfid, 0U);
BOOST_CHECK_EQUAL(fh1._fro, std::size_t(0));
BOOST_CHECK_EQUAL(fh1._ts_sec, std::time_t(0));
- BOOST_CHECK_EQUAL(fh1._ts_nsec, uint32_t(0));
+ BOOST_CHECK_EQUAL(fh1._ts_nsec, u_int32_t(0));
BOOST_CHECK(!fh1.get_owi());
}
@@ -178,7 +178,7 @@
BOOST_CHECK_EQUAL(fh2._lfid, lfid);
BOOST_CHECK_EQUAL(fh2._fro, fro);
BOOST_CHECK_EQUAL(fh2._ts_sec, std::time_t(0));
- BOOST_CHECK_EQUAL(fh2._ts_nsec, uint32_t(0));
+ BOOST_CHECK_EQUAL(fh2._ts_nsec, u_int32_t(0));
::clock_gettime(CLOCK_REALTIME, &ts);
fh2.set_time(ts);
BOOST_CHECK_EQUAL(fh2._ts_sec, ts.tv_sec);