Author: kpvdr
Date: 2009-01-19 11:36:27 -0500 (Mon, 19 Jan 2009)
New Revision: 3053
Modified:
store/trunk/cpp/lib/jrnl/file_hdr.hpp
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jcntl.hpp
store/trunk/cpp/lib/jrnl/jinf.cpp
store/trunk/cpp/lib/jrnl/rmgr.cpp
store/trunk/cpp/lib/jrnl/rmgr.hpp
store/trunk/cpp/lib/jrnl/wmgr.cpp
store/trunk/cpp/tests/jrnl/
store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp
store/trunk/cpp/tests/jrnl/_ut_rec_hdr.cpp
Log:
Further changes preparing for the implementation of auto-expand - continuing to make
distinctions between the logical and physical file ids (lfid and pfid respectively) in the
code. This checkin centers around class fhdr.
Modified: store/trunk/cpp/lib/jrnl/file_hdr.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/file_hdr.hpp 2009-01-19 16:29:37 UTC (rev 3052)
+++ store/trunk/cpp/lib/jrnl/file_hdr.hpp 2009-01-19 16:36:27 UTC (rev 3053)
@@ -65,7 +65,7 @@
* +---+---+---+---+---+---+---+---+ | struct hdr
* | first rid in file | |
* +---+---+---+---+---+---+---+---+ -+
- * | fid | lid | reserved (0) |
+ * | pfid | lfid | reserved (0) |
* +---+---+---+---+---+---+---+---+
* | fro |
* +---+---+---+---+---+---+---+---+
@@ -76,8 +76,8 @@
* v = file version (If the format or encoding of this file changes, then this
* number should be incremented)
* e = endian flag, false (0x00) for little endian, true (0x01) for big endian
- * fid = File ID (number used in naming file)
- * lid = Logical ID (order used in circular buffer)
+ * pfid = File ID (number used in naming file)
+ * lfid = Logical ID (order used in circular buffer)
* fro = First record offset, offset from start of file to first record header
* </pre>
*
@@ -88,8 +88,8 @@
*/
struct file_hdr : rec_hdr
{
- u_int16_t _fid; ///< File ID (fid)
- u_int16_t _lid; ///< Logical ID (lid)
+ u_int16_t _pfid; ///< Physical file ID (pfid)
+ u_int16_t _lfid; ///< Logical file ID (lfid)
u_int32_t _res; ///< Reserved (for alignment/flags)
#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
u_int32_t _filler0; ///< Big-endian filler for 32-bit size_t
@@ -116,7 +116,7 @@
/**
* \brief Default constructor, which sets all values to 0.
*/
- inline file_hdr(): rec_hdr(), _fid(0), _lid(0), _res(0),
+ inline file_hdr(): rec_hdr(), _pfid(0), _lfid(0), _res(0),
#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
_filler0(0),
#endif
@@ -144,9 +144,9 @@
* \brief Convenience constructor which initializes values during construction.
*/
inline file_hdr(const u_int32_t magic, const u_int8_t version, const u_int64_t
rid,
- const u_int16_t fid, const u_int16_t lid, const std::size_t fro,
+ const u_int16_t pfid, const u_int16_t lfid, const std::size_t fro,
const bool owi, const bool settime = false):
- rec_hdr(magic, version, rid, owi), _fid(fid), _lid(lid), _res(0),
+ rec_hdr(magic, version, rid, owi), _pfid(pfid), _lfid(lfid), _res(0),
#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
_filler0(0),
#endif
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-01-19 16:29:37 UTC (rev 3052)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-01-19 16:36:27 UTC (rev 3053)
@@ -894,7 +894,7 @@
assert(ifsp->good());
if (fhdr._magic == RHM_JDAT_FILE_MAGIC)
{
- assert(fhdr._fid == fid);
+ assert(fhdr._lfid == fid);
if (!rd._fro)
rd._fro = fhdr._fro;
std::streamoff foffs = jump_fro ? fhdr._fro : JRNL_DBLK_SIZE *
JRNL_SBLK_SIZE;
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2009-01-19 16:29:37 UTC (rev 3052)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2009-01-19 16:36:27 UTC (rev 3053)
@@ -561,14 +561,14 @@
inline u_int32_t get_wr_outstanding_aio_dblks() const
{ return _wrfc.aio_outstanding_dblks(); }
- inline u_int32_t get_wr_outstanding_aio_dblks(u_int16_t pi) const
- { return _lpmgr.get_fcntlp(pi)->wr_aio_outstanding_dblks(); }
+ inline u_int32_t get_wr_outstanding_aio_dblks(u_int16_t lfid) const
+ { return _lpmgr.get_fcntlp(lfid)->wr_aio_outstanding_dblks(); }
inline u_int32_t get_rd_outstanding_aio_dblks() const
{ return _rrfc.aio_outstanding_dblks(); }
- inline u_int32_t get_rd_outstanding_aio_dblks(u_int16_t pi) const
- { return _lpmgr.get_fcntlp(pi)->rd_aio_outstanding_dblks(); }
+ inline u_int32_t get_rd_outstanding_aio_dblks(u_int16_t lfid) const
+ { return _lpmgr.get_fcntlp(lfid)->rd_aio_outstanding_dblks(); }
inline u_int16_t get_rd_fid() const { return _rrfc.index(); }
inline u_int16_t get_wr_fid() const { return _wrfc.index(); }
@@ -634,7 +634,7 @@
inline u_int16_t num_jfiles() const { return _lpmgr.num_jfiles(); }
- inline fcntl* get_fcntlp(const u_int16_t fid) const { return
_lpmgr.get_fcntlp(fid); }
+ inline fcntl* get_fcntlp(const u_int16_t lfid) const { return
_lpmgr.get_fcntlp(lfid); }
inline u_int32_t jfsize_sblks() const { return _jfsize_sblks; }
Modified: store/trunk/cpp/lib/jrnl/jinf.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jinf.cpp 2009-01-19 16:29:37 UTC (rev 3052)
+++ store/trunk/cpp/lib/jrnl/jinf.cpp 2009-01-19 16:36:27 UTC (rev 3053)
@@ -161,17 +161,17 @@
jinf::analyze()
{
bool done = false;
- lp_map early_map; // map for all owi flags same as fid 0
- lp_map late_map; // map for all owi flags opposite to fid 0
+ lp_map early_map; // map for all owi flags same as pfid 0
+ lp_map late_map; // map for all owi flags opposite to pfid 0
if (!_valid_flag)
validate();
done = false;
- for (u_int16_t fid=0; fid<_num_jfiles && !done; fid++)
+ for (u_int16_t pfid=0; pfid<_num_jfiles && !done; pfid++)
{
std::ostringstream oss;
oss << _jdir << "/" << _base_filename <<
".";
- oss << std::setw(4) << std::setfill('0') << std::hex
<< fid;
+ oss << std::setw(4) << std::setfill('0') << std::hex
<< pfid;
oss << "." << JRNL_DATA_EXTENSION;
std::ifstream jifs(oss.str().c_str());
if (!jifs.good())
@@ -180,29 +180,29 @@
jifs.read((char*)&fhdr, sizeof(fhdr));
if (fhdr._magic != RHM_JDAT_FILE_MAGIC) // No file header
{
- if (!fid) // fid 0 == lid 0 cannot be empty
+ if (!pfid) // pfid 0 == lid 0 cannot be empty
throw jexception(jerrno::JERR_JINF_JDATEMPTY, "jinf",
"analyze");
_frot = true;
done = true;
}
else
{
- assert(fid == fhdr._fid);
- if (fid == 0)
+ assert(pfid == fhdr._pfid);
+ if (pfid == 0)
{
_initial_owi = fhdr.get_owi();
- early_map.insert(fhdr._lid, fid);
+ early_map.insert(fhdr._lfid, pfid);
}
else
{
if (_initial_owi == fhdr.get_owi())
- early_map.insert(fhdr._lid, fid);
+ early_map.insert(fhdr._lfid, pfid);
else
- late_map.insert(fhdr._lid, fid);
+ late_map.insert(fhdr._lfid, pfid);
}
}
jifs.close();
- } // for (fid)
+ } // for (pfid)
// If this is not the first rotation, all files should be in either early or late
maps
if (!_frot) assert(early_map.size() + late_map.size() == _num_jfiles);
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-01-19 16:29:37 UTC (rev 3052)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-01-19 16:36:27 UTC (rev 3053)
@@ -620,14 +620,6 @@
}
void
-rmgr::consume_fhdr()
-{
- // Set read pointers to first dblk after file header
- _rrfc.add_subm_cnt_dblks(JRNL_SBLK_SIZE);
- _rrfc.add_cmpl_cnt_dblks(JRNL_SBLK_SIZE);
-}
-
-void
rmgr::rotate_page()
{
_page_cb_arr[_pg_index]._rdblks = 0;
Modified: store/trunk/cpp/lib/jrnl/rmgr.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.hpp 2009-01-19 16:29:37 UTC (rev 3052)
+++ store/trunk/cpp/lib/jrnl/rmgr.hpp 2009-01-19 16:36:27 UTC (rev 3053)
@@ -97,7 +97,6 @@
iores skip(data_tok* dtokp);
iores aio_cycle();
iores init_aio_reads(const int16_t first_uninit, const u_int16_t num_uninit);
- void consume_fhdr();
void rotate_page();
u_int32_t dblks_rem() const;
void set_params_null(void** const datapp, std::size_t& dsize, void** const
xidpp,
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2009-01-19 16:29:37 UTC (rev 3052)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2009-01-19 16:36:27 UTC (rev 3053)
@@ -774,7 +774,7 @@
else
{
file_hdr* fhp = (file_hdr*)aiocbp->u.c.buf;
- oss << "fid=" << fhp->_fid;
+ oss << "fid=" << fhp->_pfid;
}
oss << " size=" << aiocbp->u.c.nbytes;
oss << " offset=" << aiocbp->u.c.offset <<
" fh=" << aiocbp->aio_fildes << "]";
@@ -870,10 +870,10 @@
}
else // File header writes have no pcb
{
- // get fid from original file header record, update pointers for that fid
+ // get lfid from original file header record, update info for that lfid
file_hdr* fhp = (file_hdr*)aiocbp->u.c.buf;
- u_int32_t fid = fhp->_fid;
- fcntl* fcntlp = _jc->get_fcntlp(fid);
+ u_int32_t lfid = fhp->_lfid;
+ fcntl* fcntlp = _jc->get_fcntlp(lfid);
fcntlp->add_wr_cmpl_cnt_dblks(JRNL_SBLK_SIZE);
fcntlp->decr_aio_cnt();
fcntlp->set_wr_fhdr_aio_outstanding(false);
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_lfmgr
_ut_rec_hdr
_ut_time_ns
_ut_txn_map
_st_basic
_st_basic_txn
_st_read
_st_read_txn
_st_auto_expand
.valgrind.supp
.valgrindrc
+ .deps
.libs
Makefile
Makefile.in
jtest
_ut_enq_map
_ut_arr_cnt
_ut_jdir
_ut_jerrno
_ut_jexception
_ut_jinf
_ut_lpmgr
_ut_rec_hdr
_ut_time_ns
_ut_txn_map
_st_basic
_st_basic_txn
_st_read
_st_read_txn
_st_auto_expand
.valgrind.supp
.valgrindrc
Modified: store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2009-01-19 16:29:37 UTC (rev 3052)
+++ store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2009-01-19 16:36:27 UTC (rev 3053)
@@ -142,7 +142,7 @@
{
const file_hdr fh = i->second;
cout << " " << cnt << ": owi="
<< (fh.get_owi()?"t":"f") << hex << "
frid=0x" << fh._rid;
- cout << " pfid=0x" << fh._fid << "
lfid=0x" << fh._lid << " fro=0x" << fh._fro << dec
<< endl;
+ cout << " pfid=0x" << fh._pfid << "
lfid=0x" << fh._lfid << " fro=0x" << fh._fro << dec
<< endl;
}
}
@@ -246,10 +246,10 @@
if (itr == _map.end()) BOOST_FAIL("Unable to find lfid="
<< after_lfid << " in map.");
file_hdr fh = itr->second;
_map.erase(lfid);
- fh._lid += num_files;
+ fh._lfid += num_files;
if (lfid == _oldest_lfid)
_oldest_lfid += num_files;
- _map.insert(lppair(fh._lid, fh));
+ _map.insert(lppair(fh._lfid, fh));
}
}
@@ -273,7 +273,7 @@
{
pfid_list.clear();
for (lpmap_citr i = _map.begin(); i != _map.end(); i++)
- pfid_list.push_back(i->second._fid);
+ pfid_list.push_back(i->second._pfid);
}
void get_lfid_list(vector<u_int16_t>& lfid_list)
@@ -281,7 +281,7 @@
lfid_list.clear();
lfid_list.assign(_map.size(), 0);
for (lpmap_citr i = _map.begin(); i != _map.end(); i++)
- lfid_list[i->second._fid] = i->first;
+ lfid_list[i->second._pfid] = i->first;
}
/*
@@ -304,10 +304,10 @@
// Because a simulated failure would leave lfid dups in map and last_fid
would not exist in map in this
// case, we must find lfid_stop via pfid instead. Search for pfid ==
num_files.
lpmap_citr itr = _map.begin();
- while (itr != _map.end() && itr->second._fid != _num_used_files -
1) itr++;
+ while (itr != _map.end() && itr->second._pfid != _num_used_files -
1) itr++;
if (itr == _map.end())
BOOST_FAIL("check(): Unable to find pfid=" <<
(_num_used_files - 1) << " in map.");
- const u_int16_t lfid_stop = itr->second._lid;
+ const u_int16_t lfid_stop = itr->second._lfid;
std::size_t fidl_index = 0;
for (u_int16_t lfid_cnt = lfid_start; lfid_cnt < lfid_stop; lfid_cnt++,
fidl_index++)
@@ -316,7 +316,7 @@
lpmap_citr itr = _map.find(lfid);
if (itr == _map.end())
BOOST_FAIL("check(): Unable to find lfid=" << lfid
<< " in map.");
- BOOST_CHECK_EQUAL(itr->second._fid, pfidl[fidl_index]);
+ BOOST_CHECK_EQUAL(itr->second._pfid, pfidl[fidl_index]);
}
}
@@ -328,12 +328,12 @@
switch (_map.count(lfid))
{
case 1:
- return _map.find(lfid)->second._fid;
+ return _map.find(lfid)->second._pfid;
case 2:
for (lpmap_citr itr = _map.lower_bound(lfid); itr !=
_map.upper_bound(lfid); itr++)
{
if (itr->second.get_owi() != initial_owi)
- return itr->second._fid;
+ return itr->second._pfid;
}
default:;
}
@@ -387,10 +387,10 @@
u_int16_t pfid = 0;
for (lpmap_citr itr = _map.begin(); itr != _map.end(); itr++, pfid++)
{
- if (itr->second._fid == 0 && itr->second._magic == 0) //
empty header, use pfid counter instaed
+ if (itr->second._pfid == 0 && itr->second._magic == 0) //
empty header, use pfid counter instaed
create_journal_file(pfid, itr->second, _base_filename);
else
- create_journal_file(itr->second._fid, itr->second,
_base_filename);
+ create_journal_file(itr->second._pfid, itr->second,
_base_filename);
}
}
@@ -452,8 +452,8 @@
#endif
fh._uflag = owi ? rec_hdr::HDR_OVERWRITE_INDICATOR_MASK : 0;
fh._rid = frid;
- fh._fid = pfid;
- fh._lid = lfid;
+ fh._pfid = pfid;
+ fh._lfid = lfid;
fh._fro = no_enq ? 0 : 0x200;
timespec ts;
::clock_gettime(CLOCK_REALTIME, &ts);
Modified: store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp 2009-01-19 16:29:37 UTC (rev 3052)
+++ store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp 2009-01-19 16:36:27 UTC (rev 3053)
@@ -186,15 +186,15 @@
BOOST_CHECK_EQUAL(res.size(), u_int16_t(0));
}
- static void insert(lfid_pfid_map& lfm, lpmgr& lm, test_jrnl& jc, const
u_int16_t after_lid, const u_int16_t incr = 1)
+ static void insert(lfid_pfid_map& lfm, lpmgr& lm, test_jrnl& jc, const
u_int16_t after_lfid, const u_int16_t incr = 1)
{
flist pfidl;
flist lfidl;
const u_int16_t num_jfiles = lm.num_jfiles();
- lfm.journal_insert(after_lid, incr);
+ lfm.journal_insert(after_lfid, incr);
lfm.get_pfid_list(pfidl);
lfm.get_lfid_list(lfidl);
- lm.insert(after_lid, &jc, &jc.new_fcntl, incr);
+ lm.insert(after_lfid, &jc, &jc.new_fcntl, incr);
BOOST_CHECK_EQUAL(lm.num_jfiles(), num_jfiles + incr);
lpmgr_test_helper::check_pfids_lfids(lm, pfidl, lfidl);
}
@@ -280,7 +280,7 @@
}
}
- static void check_insert(lfid_pfid_map& lfm, lpmgr& lm, test_jrnl& jc,
const u_int16_t after_lid,
+ static void check_insert(lfid_pfid_map& lfm, lpmgr& lm, test_jrnl& jc,
const u_int16_t after_lfid,
const u_int16_t incr = 1)
{
const u_int16_t num_jfiles = lm.num_jfiles();
@@ -290,7 +290,7 @@
bool legal = lm.is_ae() && num_jfiles + incr <=
effective_ae_max_jfiles;
if (legal)
{
- insert(lfm, lm, jc, after_lid, incr);
+ insert(lfm, lm, jc, after_lfid, incr);
BOOST_CHECK_EQUAL(lm.num_jfiles(), num_jfiles + incr);
BOOST_CHECK_EQUAL(lm.ae_jfiles_rem(), effective_ae_max_jfiles - num_jfiles -
incr);
}
@@ -298,7 +298,7 @@
{
try
{
- insert(lfm, lm, jc, after_lid, incr);
+ insert(lfm, lm, jc, after_lfid, incr);
if (lm.is_ae())
BOOST_ERROR("lpmgr::insert() succeeded and exceeded
limit");
else
@@ -607,11 +607,11 @@
* Check that insert() works correctly after initialize() and shifts the pfid sequence
beyond the insert point correctly:
*
* The following sequence is tested:
-* initialize 4 pfids=[0,1,2,3] lfids=[0,1,2,3]
-* insert 1 after lid 0 pfids=[0,4,1,2,3] lfids=[0,2,3,4,1]
-* insert 2 after lid 2 pfids=[0,4,1,5,6,2,3] lfids=[0,2,5,6,1,3,4]
-* insert 1 after lid 6 pfids=[0,4,1,5,6,2,3,7] lfids=[0,2,5,6,1,3,4,7]
-* issert 1 after lid 3 pfids=[0,4,1,5,8,6,2,3,7] lfids=[0,2,6,7,1,3,5,8,4]
+* initialize 4 pfids=[0,1,2,3] lfids=[0,1,2,3]
+* insert 1 after lfid 0 pfids=[0,4,1,2,3] lfids=[0,2,3,4,1]
+* insert 2 after lfid 2 pfids=[0,4,1,5,6,2,3] lfids=[0,2,5,6,1,3,4]
+* insert 1 after lfid 6 pfids=[0,4,1,5,6,2,3,7] lfids=[0,2,5,6,1,3,4,7]
+* issert 1 after lfid 3 pfids=[0,4,1,5,8,6,2,3,7] lfids=[0,2,6,7,1,3,5,8,4]
*/
QPID_AUTO_TEST_CASE(initialize_insert)
{
@@ -638,11 +638,11 @@
* Check that insert() works correctly after recover() and shifts the pfid sequence beyond
the insert point correctly:
*
* The following sequence is tested:
-* recover 4 pfids=[0,2,3,1] lfids=[0,3,1,2]
-* insert 1 after lid 0 pfids=[0,4,2,3,1] lfids=[0,4,2,3,1]
-* insert 2 after lid 2 pfids=[0,4,2,5,6,3,1] lfids=[0,6,2,5,1,3,4]
-* insert 1 after lid 6 pfids=[0,4,2,5,6,3,1,7] lfids=[0,6,2,5,1,3,4,7]
-* issert 1 after lid 3 pfids=[0,4,2,5,8,6,3,1,7] lfids=[0,7,2,6,1,3,5,8,4]
+* recover 4 pfids=[0,2,3,1] lfids=[0,3,1,2]
+* insert 1 after lfid 0 pfids=[0,4,2,3,1] lfids=[0,4,2,3,1]
+* insert 2 after lfid 2 pfids=[0,4,2,5,6,3,1] lfids=[0,6,2,5,1,3,4]
+* insert 1 after lfid 6 pfids=[0,4,2,5,6,3,1,7] lfids=[0,6,2,5,1,3,4,7]
+* issert 1 after lfid 3 pfids=[0,4,2,5,8,6,3,1,7] lfids=[0,7,2,6,1,3,5,8,4]
*/
QPID_AUTO_TEST_CASE(recover_insert)
{
@@ -818,25 +818,25 @@
for (int i = 0; i < num_inserts; i++)
{
const u_int16_t size = lm.num_jfiles();
- const u_int16_t after_lid = u_int16_t(1.0 * size * ::drand48());
+ const u_int16_t after_lfid = u_int16_t(1.0 * size * ::drand48());
const u_int16_t num_jfiles = 1 + u_int16_t(4.0 * ::drand48());
const bool legal = lm.ae_max_jfiles()
? size + num_jfiles <= lm.ae_max_jfiles()
: size + num_jfiles <= JRNL_MAX_NUM_FILES;
if (legal)
{
- lfm.journal_insert(after_lid, num_jfiles);
+ lfm.journal_insert(after_lfid, num_jfiles);
lfm.get_pfid_list(pfidl);
lfm.get_lfid_list(lfidl);
- lm.insert(after_lid, &jc, &jc.new_fcntl, num_jfiles);
+ lm.insert(after_lfid, &jc, &jc.new_fcntl, num_jfiles);
lpmgr_test_helper::check_pfids_lfids(lm, pfidl, lfidl);
}
else
{
try
{
- lm.insert(after_lid, &jc, &jc.new_fcntl, num_jfiles);
+ lm.insert(after_lfid, &jc, &jc.new_fcntl, num_jfiles);
BOOST_FAIL("lpmgr::insert() succeeded and exceeded
limit");
}
catch (const jexception& e)
Modified: store/trunk/cpp/tests/jrnl/_ut_rec_hdr.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_rec_hdr.cpp 2009-01-19 16:29:37 UTC (rev 3052)
+++ store/trunk/cpp/tests/jrnl/_ut_rec_hdr.cpp 2009-01-19 16:36:27 UTC (rev 3053)
@@ -144,8 +144,8 @@
const u_int8_t version = 0xa5;
const u_int16_t uflag = 0x5537;
const u_int64_t rid = 0xfedcba9876543210ULL;
- const u_int16_t fid = 0xfedcU;
- const u_int16_t lid = 0xf0e1U;
+ const u_int16_t pfid = 0xfedcU;
+ const u_int16_t lfid = 0xf0e1U;
#ifdef JRNL_32_BIT
const std::size_t fro = 0xfedcba98UL;
#else
@@ -161,8 +161,8 @@
BOOST_CHECK_EQUAL(fh1._eflag, 0);
BOOST_CHECK_EQUAL(fh1._uflag, 0);
BOOST_CHECK_EQUAL(fh1._rid, 0ULL);
- BOOST_CHECK_EQUAL(fh1._fid, 0UL);
- BOOST_CHECK_EQUAL(fh1._lid, 0U);
+ BOOST_CHECK_EQUAL(fh1._pfid, 0UL);
+ 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));
@@ -170,7 +170,7 @@
}
{
- file_hdr fh2(magic, version, rid, fid, lid, fro, owi, false);
+ file_hdr fh2(magic, version, rid, pfid, lfid, fro, owi, false);
BOOST_CHECK_EQUAL(fh2._magic, magic);
BOOST_CHECK_EQUAL(fh2._version, version);
#ifdef JRNL_LITTLE_ENDIAN
@@ -180,8 +180,8 @@
#endif
BOOST_CHECK_EQUAL(fh2._uflag, (const
u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK);
BOOST_CHECK_EQUAL(fh2._rid, rid);
- BOOST_CHECK_EQUAL(fh2._fid, fid );
- BOOST_CHECK_EQUAL(fh2._lid, lid);
+ BOOST_CHECK_EQUAL(fh2._pfid, pfid );
+ 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));
@@ -205,7 +205,7 @@
}
{
- file_hdr fh3(magic, version, rid, fid, lid, fro, owi, true);
+ file_hdr fh3(magic, version, rid, pfid, lfid, fro, owi, true);
BOOST_CHECK_EQUAL(fh3._magic, magic);
BOOST_CHECK_EQUAL(fh3._version, version);
#ifdef JRNL_LITTLE_ENDIAN
@@ -215,8 +215,8 @@
#endif
BOOST_CHECK_EQUAL(fh3._uflag, (const
u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK);
BOOST_CHECK_EQUAL(fh3._rid, rid);
- BOOST_CHECK_EQUAL(fh3._fid, fid);
- BOOST_CHECK_EQUAL(fh3._lid, lid);
+ BOOST_CHECK_EQUAL(fh3._pfid, pfid);
+ BOOST_CHECK_EQUAL(fh3._lfid, lfid);
BOOST_CHECK_EQUAL(fh3._fro, fro);
BOOST_CHECK(fh3._ts_sec - ts.tv_sec <= 1); // No more than 1 sec difference
}