Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3C9CA10E1E for ; Tue, 8 Oct 2013 15:09:42 +0000 (UTC) Received: (qmail 38248 invoked by uid 500); 8 Oct 2013 15:09:40 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 38169 invoked by uid 500); 8 Oct 2013 15:09:35 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 38082 invoked by uid 99); 8 Oct 2013 15:09:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 15:09:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 15:09:25 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DCC442388B43; Tue, 8 Oct 2013 15:09:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1530301 [4/8] - in /qpid/trunk/qpid: cpp/src/tests/legacystore/ cpp/src/tests/legacystore/federation/ cpp/src/tests/legacystore/jrnl/ cpp/src/tests/legacystore/jrnl/jtt/ cpp/src/tests/legacystore/python_tests/ tools/src/py/ tools/src/py/qp... Date: Tue, 08 Oct 2013 15:09:01 -0000 To: commits@qpid.apache.org From: astitcher@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131008150904.DCC442388B43@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/_ut_rec_hdr.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/_ut_rec_hdr.cpp?rev=1530301&view=auto ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/_ut_rec_hdr.cpp (added) +++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/_ut_rec_hdr.cpp Tue Oct 8 15:09:00 2013 @@ -0,0 +1,438 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +#include "../unit_test.h" + +#include +#include +#include "qpid/legacystore/jrnl/deq_hdr.h" +#include "qpid/legacystore/jrnl/enq_hdr.h" +#include "qpid/legacystore/jrnl/file_hdr.h" +#include "qpid/legacystore/jrnl/jcfg.h" +#include "qpid/legacystore/jrnl/rec_tail.h" +#include "qpid/legacystore/jrnl/txn_hdr.h" + +using namespace boost::unit_test; +using namespace mrg::journal; +using namespace std; + +QPID_AUTO_TEST_SUITE(rec_hdr_suite) + +const string test_filename("_ut_rec_hdr"); + +QPID_AUTO_TEST_CASE(hdr_class) +{ + cout << test_filename << ".hdr_class: " << flush; + rec_hdr h1; + BOOST_CHECK_EQUAL(h1._magic, 0UL); + BOOST_CHECK_EQUAL(h1._version, 0); + BOOST_CHECK_EQUAL(h1._eflag, 0); + BOOST_CHECK_EQUAL(h1._uflag, 0); + BOOST_CHECK_EQUAL(h1._rid, 0ULL); + BOOST_CHECK(!h1.get_owi()); + + const u_int32_t magic = 0x89abcdefUL; + const u_int16_t uflag = 0x5537; + const u_int8_t version = 0xef; + const u_int64_t rid = 0x123456789abcdef0ULL; + const bool owi = true; + + rec_hdr h2(magic, version, rid, owi); + BOOST_CHECK_EQUAL(h2._magic, magic); + BOOST_CHECK_EQUAL(h2._version, version); +#ifdef JRNL_LITTLE_ENDIAN + BOOST_CHECK_EQUAL(h2._eflag, RHM_LENDIAN_FLAG); +#else + BOOST_CHECK_EQUAL(h2._eflag, RHM_BENDIAN_FLAG); +#endif + BOOST_CHECK_EQUAL(h2._uflag, (const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK); + BOOST_CHECK_EQUAL(h2._rid, rid); + BOOST_CHECK_EQUAL(h2.get_owi(), owi); + h2._uflag = uflag; + BOOST_CHECK(h2.get_owi()); + h2.set_owi(true); + BOOST_CHECK(h2.get_owi()); + BOOST_CHECK_EQUAL(h2._uflag, uflag); + h2.set_owi(false); + BOOST_CHECK(!h2.get_owi()); + BOOST_CHECK_EQUAL(h2._uflag, (uflag & ~(const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK)); + h2.set_owi(true); + BOOST_CHECK(h2.get_owi()); + BOOST_CHECK_EQUAL(h2._uflag, uflag); + + h1.hdr_copy(h2); + BOOST_CHECK_EQUAL(h1._magic, magic); + BOOST_CHECK_EQUAL(h1._version, version); +#ifdef JRNL_LITTLE_ENDIAN + BOOST_CHECK_EQUAL(h1._eflag, RHM_LENDIAN_FLAG); +#else + BOOST_CHECK_EQUAL(h1._eflag, RHM_BENDIAN_FLAG); +#endif + BOOST_CHECK_EQUAL(h1._uflag, uflag); + BOOST_CHECK_EQUAL(h1._rid, rid); + BOOST_CHECK(h1.get_owi()); + BOOST_CHECK_EQUAL(h1._uflag, uflag); + + h1.reset(); + BOOST_CHECK_EQUAL(h1._magic, 0UL); + BOOST_CHECK_EQUAL(h1._version, 0); + BOOST_CHECK_EQUAL(h1._eflag, 0); + BOOST_CHECK_EQUAL(h1._uflag, 0); + BOOST_CHECK_EQUAL(h1._rid, 0ULL); + BOOST_CHECK(!h1.get_owi()); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(rec_tail_class) +{ + cout << test_filename << ".rec_tail_class: " << flush; + const u_int32_t magic = 0xfedcba98; + const u_int64_t rid = 0xfedcba9876543210ULL; + const u_int32_t xmagic = ~magic; + + { + rec_tail rt1; + BOOST_CHECK_EQUAL(rt1._xmagic, 0xffffffffUL); + BOOST_CHECK_EQUAL(rt1._rid, 0ULL); + } + + { + rec_tail rt2(magic, rid); + BOOST_CHECK_EQUAL(rt2._xmagic, magic); + BOOST_CHECK_EQUAL(rt2._rid, rid); + } + + { + rec_hdr h(magic, RHM_JDAT_VERSION, rid, true); + rec_tail rt3(h); + BOOST_CHECK_EQUAL(rt3._xmagic, xmagic); + BOOST_CHECK_EQUAL(rt3._rid, rid); + } + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(file_hdr_class) +{ + cout << test_filename << ".file_hdr_class: " << flush; + const u_int32_t magic = 0xfedcba98UL; + const u_int8_t version = 0xa5; + const u_int16_t uflag = 0x5537; + const u_int64_t rid = 0xfedcba9876543210ULL; + const u_int16_t pfid = 0xfedcU; + const u_int16_t lfid = 0xf0e1U; +#ifdef JRNL_32_BIT + const std::size_t fro = 0xfedcba98UL; +#else + const std::size_t fro = 0xfedcba9876543210ULL; +#endif + timespec ts; + const bool owi = true; + + { + file_hdr fh1; + BOOST_CHECK_EQUAL(fh1._magic, 0UL); + BOOST_CHECK_EQUAL(fh1._version, 0); + BOOST_CHECK_EQUAL(fh1._eflag, 0); + BOOST_CHECK_EQUAL(fh1._uflag, 0); + BOOST_CHECK_EQUAL(fh1._rid, 0ULL); + 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, u_int32_t(0)); + BOOST_CHECK(!fh1.get_owi()); + } + + { + 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 + BOOST_CHECK_EQUAL(fh2._eflag, RHM_LENDIAN_FLAG); +#else + BOOST_CHECK_EQUAL(fh2._eflag, RHM_BENDIAN_FLAG); +#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._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, u_int32_t(0)); + ::clock_gettime(CLOCK_REALTIME, &ts); + fh2.set_time(ts); + BOOST_CHECK_EQUAL(fh2._ts_sec, ts.tv_sec); + BOOST_CHECK_EQUAL(fh2._ts_nsec, u_int32_t(ts.tv_nsec)); + BOOST_CHECK(fh2.get_owi()); + + fh2._uflag = uflag; + BOOST_CHECK(fh2.get_owi()); + + fh2.set_owi(false); + BOOST_CHECK(!fh2.get_owi()); + BOOST_CHECK_EQUAL(fh2._uflag, + (uflag & ~(const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK)); + + fh2.set_owi(true); + BOOST_CHECK(fh2.get_owi()); + BOOST_CHECK_EQUAL(fh2._uflag, uflag); + } + + { + 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 + BOOST_CHECK_EQUAL(fh3._eflag, RHM_LENDIAN_FLAG); +#else + BOOST_CHECK_EQUAL(fh3._eflag, RHM_BENDIAN_FLAG); +#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._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 + } + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(enq_hdr_class) +{ + cout << test_filename << ".enq_hdr_class: " << flush; + const u_int32_t magic = 0xfedcba98UL; + const u_int8_t version = 0xa5; + const u_int64_t rid = 0xfedcba9876543210ULL; + const u_int16_t uflag = 0x5537; +#ifdef JRNL_32_BIT + const std::size_t xidsize = 0xfedcba98UL; + const std::size_t dsize = 0x76543210UL; +#else + const std::size_t xidsize = 0xfedcba9876543210ULL; + const std::size_t dsize = 0x76543210fedcba98ULL; +#endif + const bool owi = true; + + { + enq_hdr eh1; + BOOST_CHECK_EQUAL(eh1._magic, 0UL); + BOOST_CHECK_EQUAL(eh1._version, 0); + BOOST_CHECK_EQUAL(eh1._eflag, 0); + BOOST_CHECK_EQUAL(eh1._uflag, 0); + BOOST_CHECK_EQUAL(eh1._rid, 0ULL); + BOOST_CHECK_EQUAL(eh1._xidsize, std::size_t(0)); + BOOST_CHECK_EQUAL(eh1._dsize, std::size_t(0)); + BOOST_CHECK(!eh1.get_owi()); + } + + { + enq_hdr eh2(magic, version, rid, xidsize, dsize, owi, false); + BOOST_CHECK_EQUAL(eh2._magic, magic); + BOOST_CHECK_EQUAL(eh2._version, version); +#ifdef JRNL_LITTLE_ENDIAN + BOOST_CHECK_EQUAL(eh2._eflag, RHM_LENDIAN_FLAG); +#else + BOOST_CHECK_EQUAL(eh2._eflag, RHM_BENDIAN_FLAG); +#endif + BOOST_CHECK_EQUAL(eh2._uflag, (const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK); + BOOST_CHECK_EQUAL(eh2._rid, rid); + BOOST_CHECK_EQUAL(eh2._xidsize, xidsize); + BOOST_CHECK_EQUAL(eh2._dsize, dsize); + BOOST_CHECK(eh2.get_owi()); + BOOST_CHECK(!eh2.is_transient()); + BOOST_CHECK(!eh2.is_external()); + + eh2._uflag = uflag; + BOOST_CHECK(eh2.get_owi()); + BOOST_CHECK(eh2.is_transient()); + BOOST_CHECK(eh2.is_external()); + + eh2.set_owi(false); + BOOST_CHECK(!eh2.get_owi()); + BOOST_CHECK(eh2.is_transient()); + BOOST_CHECK(eh2.is_external()); + BOOST_CHECK_EQUAL(eh2._uflag, + (uflag & ~(const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK)); + + eh2.set_owi(true); + BOOST_CHECK(eh2.get_owi()); + BOOST_CHECK(eh2.is_transient()); + BOOST_CHECK(eh2.is_external()); + BOOST_CHECK_EQUAL(eh2._uflag, uflag); + + eh2.set_transient(false); + BOOST_CHECK(eh2.get_owi()); + BOOST_CHECK(!eh2.is_transient()); + BOOST_CHECK(eh2.is_external()); + BOOST_CHECK_EQUAL(eh2._uflag, uflag & ~(const u_int16_t)enq_hdr::ENQ_HDR_TRANSIENT_MASK); + + eh2.set_transient(true); + BOOST_CHECK(eh2.get_owi()); + BOOST_CHECK(eh2.is_transient()); + BOOST_CHECK(eh2.is_external()); + BOOST_CHECK_EQUAL(eh2._uflag, uflag); + + eh2.set_external(false); + BOOST_CHECK(eh2.get_owi()); + BOOST_CHECK(eh2.is_transient()); + BOOST_CHECK(!eh2.is_external()); + BOOST_CHECK_EQUAL(eh2._uflag, uflag & ~(const u_int16_t)enq_hdr::ENQ_HDR_EXTERNAL_MASK); + + eh2.set_external(true); + BOOST_CHECK(eh2.get_owi()); + BOOST_CHECK(eh2.is_transient()); + BOOST_CHECK(eh2.is_external()); + BOOST_CHECK_EQUAL(eh2._uflag, uflag); + } + + { + enq_hdr eh3(magic, version, rid, xidsize, dsize, owi, true); + BOOST_CHECK_EQUAL(eh3._magic, magic); + BOOST_CHECK_EQUAL(eh3._version, version); +#ifdef JRNL_LITTLE_ENDIAN + BOOST_CHECK_EQUAL(eh3._eflag, RHM_LENDIAN_FLAG); +#else + BOOST_CHECK_EQUAL(eh3._eflag, RHM_BENDIAN_FLAG); +#endif + BOOST_CHECK_EQUAL(eh3._uflag, (const u_int16_t)enq_hdr::ENQ_HDR_TRANSIENT_MASK | + (const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK); + BOOST_CHECK_EQUAL(eh3._rid, rid); + BOOST_CHECK_EQUAL(eh3._xidsize, xidsize); + BOOST_CHECK_EQUAL(eh3._dsize, dsize); + BOOST_CHECK(eh3.get_owi()); + BOOST_CHECK(eh3.is_transient()); + BOOST_CHECK(!eh3.is_external()); + } + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(deq_hdr_class) +{ + cout << test_filename << ".deq_hdr_class: " << flush; + const u_int32_t magic = 0xfedcba98UL; + const u_int8_t version = 0xa5; + const u_int16_t uflag = 0x5537; + const u_int64_t rid = 0xfedcba9876543210ULL; + const u_int64_t drid = 0x76543210fedcba98ULL; +#ifdef JRNL_32_BIT + const std::size_t xidsize = 0xfedcba98UL; +#else + const std::size_t xidsize = 0xfedcba9876543210ULL; +#endif + const bool owi = true; + + { + deq_hdr dh1; + BOOST_CHECK_EQUAL(dh1._magic, 0UL); + BOOST_CHECK_EQUAL(dh1._version, 0); + BOOST_CHECK_EQUAL(dh1._eflag, 0); + BOOST_CHECK_EQUAL(dh1._uflag, 0); + BOOST_CHECK_EQUAL(dh1._rid, 0ULL); + BOOST_CHECK_EQUAL(dh1._deq_rid, 0ULL); + BOOST_CHECK_EQUAL(dh1._xidsize, std::size_t(0)); + BOOST_CHECK(!dh1.get_owi()); + } + + { + deq_hdr dh2(magic, version, rid, drid, xidsize, owi); + BOOST_CHECK_EQUAL(dh2._magic, magic); + BOOST_CHECK_EQUAL(dh2._version, version); +#ifdef JRNL_LITTLE_ENDIAN + BOOST_CHECK_EQUAL(dh2._eflag, RHM_LENDIAN_FLAG); +#else + BOOST_CHECK_EQUAL(dh2._eflag, RHM_BENDIAN_FLAG); +#endif + BOOST_CHECK_EQUAL(dh2._uflag, (const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK); + BOOST_CHECK_EQUAL(dh2._rid, rid); + BOOST_CHECK_EQUAL(dh2._deq_rid, drid); + BOOST_CHECK_EQUAL(dh2._xidsize, xidsize); + BOOST_CHECK(dh2.get_owi()); + + dh2._uflag = uflag; + BOOST_CHECK(dh2.get_owi()); + + dh2.set_owi(false); + BOOST_CHECK(!dh2.get_owi()); + BOOST_CHECK_EQUAL(dh2._uflag, + (uflag & ~(const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK)); + + dh2.set_owi(true); + BOOST_CHECK(dh2.get_owi()); + BOOST_CHECK_EQUAL(dh2._uflag, uflag); + } + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(txn_hdr_class) +{ + cout << test_filename << ".txn_hdr_class: " << flush; + const u_int32_t magic = 0xfedcba98UL; + const u_int8_t version = 0xa5; + const u_int16_t uflag = 0x5537; + const u_int64_t rid = 0xfedcba9876543210ULL; +#ifdef JRNL_32_BIT + const std::size_t xidsize = 0xfedcba98UL; +#else + const std::size_t xidsize = 0xfedcba9876543210ULL; +#endif + const bool owi = true; + + { + txn_hdr th1; + BOOST_CHECK_EQUAL(th1._magic, 0UL); + BOOST_CHECK_EQUAL(th1._version, 0); + BOOST_CHECK_EQUAL(th1._eflag, 0); + BOOST_CHECK_EQUAL(th1._uflag, 0); + BOOST_CHECK_EQUAL(th1._rid, 0ULL); + BOOST_CHECK_EQUAL(th1._xidsize, std::size_t(0)); + BOOST_CHECK(!th1.get_owi()); + } + + { + txn_hdr th2(magic, version, rid, xidsize, owi); + BOOST_CHECK_EQUAL(th2._magic, magic); + BOOST_CHECK_EQUAL(th2._version, version); +#ifdef JRNL_LITTLE_ENDIAN + BOOST_CHECK_EQUAL(th2._eflag, RHM_LENDIAN_FLAG); +#else + BOOST_CHECK_EQUAL(th2._eflag, RHM_BENDIAN_FLAG); +#endif + BOOST_CHECK_EQUAL(th2._uflag, (const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK); + BOOST_CHECK_EQUAL(th2._rid, rid); + BOOST_CHECK_EQUAL(th2._xidsize, xidsize); + BOOST_CHECK(th2.get_owi()); + + th2._uflag = uflag; + BOOST_CHECK(th2.get_owi()); + + th2.set_owi(false); + BOOST_CHECK(!th2.get_owi()); + BOOST_CHECK_EQUAL(th2._uflag, + (uflag & ~(const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK)); + + th2.set_owi(true); + BOOST_CHECK(th2.get_owi()); + BOOST_CHECK_EQUAL(th2._uflag, uflag); + } + cout << "ok" << endl; +} + +QPID_AUTO_TEST_SUITE_END() Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/_ut_time_ns.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/_ut_time_ns.cpp?rev=1530301&view=auto ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/_ut_time_ns.cpp (added) +++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/_ut_time_ns.cpp Tue Oct 8 15:09:00 2013 @@ -0,0 +1,163 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +#include "../unit_test.h" + +#include +#include +#include "qpid/legacystore/jrnl/time_ns.h" + +using namespace boost::unit_test; +using namespace mrg::journal; +using namespace std; + +QPID_AUTO_TEST_SUITE(time_ns_suite) + +const string test_filename("_ut_time_ns"); + +QPID_AUTO_TEST_CASE(constructors) +{ + cout << test_filename << ".constructors: " << flush; + const std::time_t sec = 123; + const long nsec = 123456789; + + time_ns t1; + BOOST_CHECK_EQUAL(t1.tv_sec, 0); + BOOST_CHECK_EQUAL(t1.tv_nsec, 0); + BOOST_CHECK_EQUAL(t1.is_zero(), true); + time_ns t2(sec, nsec); + BOOST_CHECK_EQUAL(t2.tv_sec, sec); + BOOST_CHECK_EQUAL(t2.tv_nsec, nsec); + BOOST_CHECK_EQUAL(t2.is_zero(), false); + time_ns t3(t1); + BOOST_CHECK_EQUAL(t3.tv_sec, 0); + BOOST_CHECK_EQUAL(t3.tv_nsec, 0); + BOOST_CHECK_EQUAL(t3.is_zero(), true); + time_ns t4(t2); + BOOST_CHECK_EQUAL(t4.tv_sec, sec); + BOOST_CHECK_EQUAL(t4.tv_nsec, nsec); + BOOST_CHECK_EQUAL(t4.is_zero(), false); + t4.set_zero(); + BOOST_CHECK_EQUAL(t4.tv_sec, 0); + BOOST_CHECK_EQUAL(t4.tv_nsec, 0); + BOOST_CHECK_EQUAL(t4.is_zero(), true); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(operators) +{ + cout << test_filename << ".operators: " << flush; + const std::time_t sec1 = 123; + const long nsec1 = 123456789; + const std::time_t sec2 = 1; + const long nsec2 = 999999999; + const std::time_t sec_sum = sec1 + sec2 + 1; + const long nsec_sum = nsec1 + nsec2 - 1000000000; + const std::time_t sec_1_minus_2 = sec1 - sec2 - 1; + const long nsec_1_minus_2 = nsec1 - nsec2 + 1000000000; + const std::time_t sec_2_minus_1 = sec2 - sec1; + const long nsec_2_minus_1 = nsec2 - nsec1; + time_ns z; + time_ns t1(sec1, nsec1); + time_ns t2(sec2, nsec2); + + time_ns t3 = z; + BOOST_CHECK_EQUAL(t3.tv_sec, 0); + BOOST_CHECK_EQUAL(t3.tv_nsec, 0); + BOOST_CHECK_EQUAL(t3 == z, true); + BOOST_CHECK_EQUAL(t3 != z, false); + BOOST_CHECK_EQUAL(t3 > z, false); + BOOST_CHECK_EQUAL(t3 >= z, true); + BOOST_CHECK_EQUAL(t3 < z, false); + BOOST_CHECK_EQUAL(t3 <= z, true); + + t3 = t1; + BOOST_CHECK_EQUAL(t3.tv_sec, sec1); + BOOST_CHECK_EQUAL(t3.tv_nsec, nsec1); + BOOST_CHECK_EQUAL(t3 == t1, true); + BOOST_CHECK_EQUAL(t3 != t1, false); + BOOST_CHECK_EQUAL(t3 > t1, false); + BOOST_CHECK_EQUAL(t3 >= t1, true); + BOOST_CHECK_EQUAL(t3 < t1, false); + BOOST_CHECK_EQUAL(t3 <= t1, true); + + t3 += z; + BOOST_CHECK_EQUAL(t3.tv_sec, sec1); + BOOST_CHECK_EQUAL(t3.tv_nsec, nsec1); + + t3 = t2; + BOOST_CHECK_EQUAL(t3.tv_sec, sec2); + BOOST_CHECK_EQUAL(t3.tv_nsec, nsec2); + BOOST_CHECK_EQUAL(t3 == t2, true); + BOOST_CHECK_EQUAL(t3 != t2, false); + BOOST_CHECK_EQUAL(t3 > t2, false); + BOOST_CHECK_EQUAL(t3 >= t2, true); + BOOST_CHECK_EQUAL(t3 < t2, false); + BOOST_CHECK_EQUAL(t3 <= t2, true); + + t3 += z; + BOOST_CHECK_EQUAL(t3.tv_sec, sec2); + BOOST_CHECK_EQUAL(t3.tv_nsec, nsec2); + + t3 = t1; + t3 += t2; + BOOST_CHECK_EQUAL(t3.tv_sec, sec_sum); + BOOST_CHECK_EQUAL(t3.tv_nsec, nsec_sum); + + t3 = t1; + t3 -= t2; + BOOST_CHECK_EQUAL(t3.tv_sec, sec_1_minus_2); + BOOST_CHECK_EQUAL(t3.tv_nsec, nsec_1_minus_2); + + t3 = t2; + t3 -= t1; + BOOST_CHECK_EQUAL(t3.tv_sec, sec_2_minus_1); + BOOST_CHECK_EQUAL(t3.tv_nsec, nsec_2_minus_1); + + t3 = t1 + t2; + BOOST_CHECK_EQUAL(t3.tv_sec, sec_sum); + BOOST_CHECK_EQUAL(t3.tv_nsec, nsec_sum); + + t3 = t1 - t2; + BOOST_CHECK_EQUAL(t3.tv_sec, sec_1_minus_2); + BOOST_CHECK_EQUAL(t3.tv_nsec, nsec_1_minus_2); + + t3 = t2 - t1; + BOOST_CHECK_EQUAL(t3.tv_sec, sec_2_minus_1); + BOOST_CHECK_EQUAL(t3.tv_nsec, nsec_2_minus_1); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(str) +{ + cout << test_filename << ".str: " << flush; + time_ns t1(123, 123456789); + BOOST_CHECK_EQUAL(t1.str(), "123.123457"); + BOOST_CHECK_EQUAL(t1.str(9), "123.123456789"); + BOOST_CHECK_EQUAL(t1.str(0), "123"); + time_ns t2(1, 1); + BOOST_CHECK_EQUAL(t2.str(9), "1.000000001"); + time_ns t3(-12, 345); + BOOST_CHECK_EQUAL(t3.str(9), "-11.999999655"); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_SUITE_END() Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/_ut_txn_map.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/_ut_txn_map.cpp?rev=1530301&view=auto ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/_ut_txn_map.cpp (added) +++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/_ut_txn_map.cpp Tue Oct 8 15:09:00 2013 @@ -0,0 +1,106 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +#include "../unit_test.h" + +#include +#include +#include "qpid/legacystore/jrnl/txn_map.h" +#include + +using namespace boost::unit_test; +using namespace mrg::journal; +using namespace std; + +QPID_AUTO_TEST_SUITE(txn_map_suite) + +const string test_filename("_ut_txn_map"); + +// === Helper functions === + +const string make_xid(u_int64_t rid) +{ + stringstream ss; + ss << "XID-" << setfill('0') << setw(16) << hex << rid; + ss << "-0123456789abcdef"; + return ss.str(); +} + +void check_td_equal(txn_data& td1, txn_data& td2) +{ + BOOST_CHECK_EQUAL(td1._rid, td2._rid); + BOOST_CHECK_EQUAL(td1._drid, td2._drid); + BOOST_CHECK_EQUAL(td1._pfid, td2._pfid); + BOOST_CHECK_EQUAL(td1._enq_flag, td2._enq_flag); + BOOST_CHECK_EQUAL(td1._aio_compl, td2._aio_compl); +} + +// === Test suite === + +QPID_AUTO_TEST_CASE(constructor) +{ + cout << test_filename << ".constructor: " << flush; + const u_int64_t rid = 0x123456789abcdef0ULL; + const u_int64_t drid = 0xfedcba9876543210ULL; + const u_int16_t pfid = 0xfedcU; + const bool enq_flag = true; + txn_data td(rid, drid, pfid, enq_flag); + BOOST_CHECK_EQUAL(td._rid, rid); + BOOST_CHECK_EQUAL(td._drid, drid); + BOOST_CHECK_EQUAL(td._pfid, pfid); + BOOST_CHECK_EQUAL(td._enq_flag, enq_flag); + BOOST_CHECK_EQUAL(td._aio_compl, false); + + txn_map t1; + BOOST_CHECK(t1.empty()); + BOOST_CHECK_EQUAL(t1.size(), u_int32_t(0)); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(insert_get) +{ + cout << test_filename << ".insert_get: " << flush; + u_int16_t fid; + u_int64_t rid; + u_int16_t pfid_start = 0x2000U; + u_int64_t rid_begin = 0xffffffff00000000ULL; + u_int64_t rid_end = 0xffffffff00000200ULL; + + // insert with no dups + u_int64_t rid_incr_1 = 4ULL; + txn_map t2; + t2.set_num_jfiles(pfid_start + (rid_end - rid_begin)/rid_incr_1); + for (rid = rid_begin, fid = pfid_start; rid < rid_end; rid += rid_incr_1, fid++) + t2.insert_txn_data(make_xid(rid), txn_data(rid, ~rid, fid, false)); + BOOST_CHECK(!t2.empty()); + BOOST_CHECK_EQUAL(t2.size(), u_int32_t(128)); + + // get + u_int64_t rid_incr_2 = 6ULL; + for (u_int64_t rid = rid_begin; rid < rid_end; rid += rid_incr_2) + { + string xid = make_xid(rid); + BOOST_CHECK_EQUAL(t2.in_map(xid), (rid%rid_incr_1 ? false : true)); + } + cout << "ok" << endl; +} + +QPID_AUTO_TEST_SUITE_END() Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/chk_jdata URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/chk_jdata?rev=1530301&view=auto ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/chk_jdata (added) +++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/chk_jdata Tue Oct 8 15:09:00 2013 @@ -0,0 +1,32 @@ +#!/bin/bash + +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + + +JRNL_BLK_SIZE=512 # Block size in bytes +JRNL_PAGE_SIZE=256 # Journal page size in blocks +JRNL_FILE_SIZE=12 # Journal file size in pages +let END_OFFSET=${JRNL_BLK_SIZE}*${JRNL_PAGE_SIZE}*${JRNL_FILE_SIZE} +for f in jdata/test.*.jdat; do + echo $f + hexdump -C -n 1024 $f + hexdump -C -s ${END_OFFSET} $f + echo "============" +done Propchange: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/chk_jdata ------------------------------------------------------------------------------ svn:executable = * Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/cp_rtest_jrnl URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/cp_rtest_jrnl?rev=1530301&view=auto ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/cp_rtest_jrnl (added) +++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/cp_rtest_jrnl Tue Oct 8 15:09:00 2013 @@ -0,0 +1,59 @@ +#!/bin/bash + +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +JDATA_DIR=jdata +TAR_DIR=rd_test_jrnls + +function get_filename +{ + local prefix=$1 + local file_num=$2 + local suffix=$3 + + if (( file_num < 10 )); then + local num="000${file_num}" + elif (( file_num < 100 )); then + local num="00${file_num}" + elif (( file_num < 1000 )); then + local num="0${file_num}" + else + local num="${file_num}" + fi + FILENAME=${prefix}${num}${suffix} + return 0 +} + +if (( $# != 1 )); then + echo "Incorrect args, expected 1 arg (usage: \"prep \")" + exit +fi + +get_filename "t" $1 ".tar.gz" +if [[ -d ${JDATA_DIR} ]]; then + rm -rf ${JDATA_DIR}/* +else + mkdir -p ${JDATA_DIR} +fi +if [[ -f "${TAR_DIR}/${FILENAME}" ]]; then + tar -C ${JDATA_DIR} -xzf "${TAR_DIR}/${FILENAME}" +else + echo "Error: file \"${TAR_DIR}/${FILENAME}\" not found." +fi Propchange: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/cp_rtest_jrnl ------------------------------------------------------------------------------ svn:executable = * Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jhexdump URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jhexdump?rev=1530301&view=auto ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jhexdump (added) +++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jhexdump Tue Oct 8 15:09:00 2013 @@ -0,0 +1,41 @@ +#!/bin/bash + +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +if [ -z "$1" ]; then + echo "No directory specified." + exit +fi + +JDIR=$1 +echo "Target directory: ${JDIR}" + +rm -f j*.txt + +if [ -d "${JDIR}" ]; then + n=0 + for f in "${JDIR}"/*.jdat; do + echo "$f -> j$n.txt" + hexdump -C "$f" > j$n.txt + (( n += 1 )) + done +else + echo "This directory does not exist." +fi Propchange: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jhexdump ------------------------------------------------------------------------------ svn:executable = * Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_data_src.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_data_src.cpp?rev=1530301&view=auto ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_data_src.cpp (added) +++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_data_src.cpp Tue Oct 8 15:09:00 2013 @@ -0,0 +1,207 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +#include "../../unit_test.h" +#include +#include "data_src.h" +#include +#include + +using namespace boost::unit_test; +using namespace mrg::jtt; +using namespace std; + +QPID_AUTO_TEST_SUITE(jtt_data_src) + +const string test_filename("_ut_data_src"); + +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 +} + +#ifndef LONG_TEST +/* + * ============================================== + * NORMAL TESTS + * This section contains normal "make check" tests + * for building/packaging. These are built when + * LONG_TEST is _not_ defined. + * ============================================== + */ + +QPID_AUTO_TEST_CASE(data) +{ + cout << test_filename << ".data: " << flush; + BOOST_CHECK(data_src::max_dsize > 0); + for (std::size_t i=0; i<1024; i++) + { + const char* dp = data_src::get_data(i); + BOOST_CHECK_EQUAL(*dp, static_cast('0' + ((i + 1) % 10))); + } + for (std::size_t i=data_src::max_dsize-1024; i('0' + ((i + 1) % 10))); + } + const char* dp1 = data_src::get_data(data_src::max_dsize); + BOOST_CHECK_EQUAL(dp1,(char*) 0); + const char* dp2 = data_src::get_data(data_src::max_dsize + 0x1000); + BOOST_CHECK_EQUAL(dp2, (char*)0); + cout << "ok" << endl; +} + +// There is a long version of this test in _ut_long_data_src.cpp +QPID_AUTO_TEST_CASE(xid_data_xid) +{ + const std::size_t num = 64; + cout << test_filename << ".xid_data_xid: " << flush; + BOOST_CHECK_EQUAL(data_src::get_xid(1), "0"); + BOOST_CHECK_EQUAL(data_src::get_xid(2), "01"); + BOOST_CHECK_EQUAL(data_src::get_xid(3), "002"); + BOOST_CHECK_EQUAL(data_src::get_xid(4), "0003"); + BOOST_CHECK_EQUAL(data_src::get_xid(5), "00004"); + BOOST_CHECK_EQUAL(data_src::get_xid(6), "000005"); + BOOST_CHECK_EQUAL(data_src::get_xid(7), "0000006"); + BOOST_CHECK_EQUAL(data_src::get_xid(8), "00000007"); + BOOST_CHECK_EQUAL(data_src::get_xid(9), "xid:00008"); + BOOST_CHECK_EQUAL(data_src::get_xid(10), "xid:000009"); + BOOST_CHECK_EQUAL(data_src::get_xid(11), "xid:0000010"); + BOOST_CHECK_EQUAL(data_src::get_xid(12), "xid:00000011"); + BOOST_CHECK_EQUAL(data_src::get_xid(13), "xid:00000012:"); + BOOST_CHECK_EQUAL(data_src::get_xid(14), "xid:00000013:n"); + BOOST_CHECK_EQUAL(data_src::get_xid(15), "xid:00000014:no"); + std::size_t i = 15; + for (; i + +using namespace boost::unit_test; +using namespace mrg::jtt; +using namespace std; + +QPID_AUTO_TEST_SUITE(jtt_jrnl_init_params) + +const string test_filename("_ut_jrnl_init_params"); + +QPID_AUTO_TEST_CASE(constructor) +{ + cout << test_filename << ".constructor: " << flush; + const string jid = "jid"; + const string jdir = "jdir"; + const string bfn = "base filename"; + const u_int16_t num_jfiles = 123; + const bool ae = false; + const u_int16_t ae_max_jfiles = 456; + const u_int32_t jfsize_sblks = 789; + jrnl_init_params jip(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks); + BOOST_CHECK_EQUAL(jip.jid(), jid); + BOOST_CHECK_EQUAL(jip.jdir(), jdir); + BOOST_CHECK_EQUAL(jip.base_filename(), bfn); + BOOST_CHECK_EQUAL(jip.num_jfiles(), num_jfiles); + BOOST_CHECK_EQUAL(jip.is_ae(), ae); + BOOST_CHECK_EQUAL(jip.ae_max_jfiles(), ae_max_jfiles); + BOOST_CHECK_EQUAL(jip.jfsize_sblks(), jfsize_sblks); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(copy_constructor_1) +{ + cout << test_filename << ".copy_constructor_1: " << flush; + const string jid = "jid"; + const string jdir = "jdir"; + const string bfn = "base filename"; + const u_int16_t num_jfiles = 123; + const bool ae = false; + const u_int16_t ae_max_jfiles = 456; + const u_int32_t jfsize_sblks = 789; + jrnl_init_params jip1(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks); + jrnl_init_params jip2(jip1); + BOOST_CHECK_EQUAL(jip2.jid(), jid); + BOOST_CHECK_EQUAL(jip2.jdir(), jdir); + BOOST_CHECK_EQUAL(jip2.base_filename(), bfn); + BOOST_CHECK_EQUAL(jip2.num_jfiles(), num_jfiles); + BOOST_CHECK_EQUAL(jip2.is_ae(), ae); + BOOST_CHECK_EQUAL(jip2.ae_max_jfiles(), ae_max_jfiles); + BOOST_CHECK_EQUAL(jip2.jfsize_sblks(), jfsize_sblks); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(copy_constructor_2) +{ + cout << test_filename << ".copy_constructor_2: " << flush; + const string jid = "jid"; + const string jdir = "jdir"; + const string bfn = "base filename"; + const u_int16_t num_jfiles = 123; + const bool ae = false; + const u_int16_t ae_max_jfiles = 456; + const u_int32_t jfsize_sblks = 789; + jrnl_init_params::shared_ptr p(new jrnl_init_params(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks)); + jrnl_init_params jip2(p.get()); + BOOST_CHECK_EQUAL(jip2.jid(), jid); + BOOST_CHECK_EQUAL(jip2.jdir(), jdir); + BOOST_CHECK_EQUAL(jip2.base_filename(), bfn); + BOOST_CHECK_EQUAL(jip2.num_jfiles(), num_jfiles); + BOOST_CHECK_EQUAL(jip2.is_ae(), ae); + BOOST_CHECK_EQUAL(jip2.ae_max_jfiles(), ae_max_jfiles); + BOOST_CHECK_EQUAL(jip2.jfsize_sblks(), jfsize_sblks); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_SUITE_END() + Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_jrnl_instance.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_jrnl_instance.cpp?rev=1530301&view=auto ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_jrnl_instance.cpp (added) +++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_jrnl_instance.cpp Tue Oct 8 15:09:00 2013 @@ -0,0 +1,178 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +#include "../../unit_test.h" + +#include +#include "jrnl_init_params.h" +#include "jrnl_instance.h" +#include "qpid/legacystore/jrnl/jdir.h" +#include "qpid/legacystore/jrnl/jerrno.h" + +using namespace boost::unit_test; +using namespace mrg::journal; +using namespace mrg::jtt; +using namespace std; + +QPID_AUTO_TEST_SUITE(jtt_jrnl_instance) + +const string test_filename("_ut_jrnl_instance"); +const char* tdp = getenv("TMP_DATA_DIR"); +const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/var/tmp/JttTest"); + +QPID_AUTO_TEST_CASE(constructor_1) +{ + cout << test_filename << ".constructor_1: " << flush; + const string jid = "jid1"; + const string jdir = test_dir + "/test1"; + const string bfn = "test"; + const u_int16_t num_jfiles = 20; + const bool ae = false; + const u_int16_t ae_max_jfiles = 45; + const u_int32_t jfsize_sblks = 128; + + args a("a1"); + using mrg::jtt::test_case; + test_case::shared_ptr p(new test_case(1, 0, 0, 0, false, 0, 0, test_case::JTT_PERSISTNET, test_case::JDL_INTERNAL, + "t1")); + jrnl_instance ji(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks); + ji.init_tc(p, &a); + ji.run_tc(); + ji.tc_wait_compl(); + try { jdir::verify_dir(jdir, bfn); } + catch (const jexception& e) { BOOST_ERROR(e.what()); } + jdir::delete_dir(jdir); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(constructor_2) +{ + cout << test_filename << ".constructor_2: " << flush; + const string jid = "jid2"; + const string jdir = test_dir + "/test2"; + const string bfn = "test"; + const u_int16_t num_jfiles = 20; + const bool ae = false; + const u_int16_t ae_max_jfiles = 45; + const u_int32_t jfsize_sblks = 128; + + args a("a2"); + using mrg::jtt::test_case; + test_case::shared_ptr p(new test_case(2, 0, 0, 0, false, 0, 0, test_case::JTT_PERSISTNET, test_case::JDL_INTERNAL, + "t2")); + jrnl_init_params::shared_ptr jpp(new jrnl_init_params(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks)); + jrnl_instance ji(jpp); + ji.init_tc(p, &a); + ji.run_tc(); + ji.tc_wait_compl(); + try { jdir::verify_dir(jdir, bfn); } + catch (const jexception& e) { BOOST_ERROR(e.what()); } + jdir::delete_dir(jdir); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(constructor_3) +{ + cout << test_filename << ".constructor_3: " << flush; + const string jid = "jid3"; + const string jdir = test_dir + "/test3"; + const string bfn = "test"; + const u_int16_t num_jfiles = 20; + const bool ae = false; + const u_int16_t ae_max_jfiles = 45; + const u_int32_t jfsize_sblks = 128; + + args a("a3"); + using mrg::jtt::test_case; + test_case::shared_ptr p(new test_case(3, 0, 0, 0, false, 0, 0, test_case::JTT_PERSISTNET, test_case::JDL_INTERNAL, + "t3")); + jrnl_init_params::shared_ptr jpp(new jrnl_init_params(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks)); + jrnl_instance ji(jpp); + ji.init_tc(p, &a); + ji.run_tc(); + ji.tc_wait_compl(); + try { jdir::verify_dir(jdir, bfn); } + catch (const jexception& e) { BOOST_ERROR(e.what()); } + jdir::delete_dir(jdir); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(recover) +{ + cout << test_filename << ".recover: " << flush; + const string jid = "jid5"; + const string jdir = test_dir + "/test5"; + const string bfn = "test"; + const u_int16_t num_jfiles = 20; + const bool ae = false; + const u_int16_t ae_max_jfiles = 0; + const u_int32_t jfsize_sblks = 128; + + args a("a4"); + using mrg::jtt::test_case; + test_case::shared_ptr p(new test_case(5, 0, 0, 0, false, 0, 0, test_case::JTT_PERSISTNET, test_case::JDL_INTERNAL, + "t5")); + jrnl_init_params::shared_ptr jpp(new jrnl_init_params(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks)); + jrnl_instance ji(jpp); + ji.init_tc(p, &a); + ji.run_tc(); + ji.tc_wait_compl(); + try { jdir::verify_dir(jdir, bfn); } + catch (const jexception& e) { BOOST_ERROR(e.what()); } + a.recover_mode = true; + ji.init_tc(p, &a); + ji.run_tc(); + ji.tc_wait_compl(); + try { jdir::verify_dir(jdir, bfn); } + catch (const jexception& e) { BOOST_ERROR(e.what()); } + jdir::delete_dir(jdir); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(recover_no_files) +{ + cout << test_filename << ".recover_no_files: " << flush; + const string jid = "jid6"; + const string jdir = test_dir + "/test6"; + const string bfn = "test"; + const u_int16_t num_jfiles = 20; + const bool ae = false; + const u_int16_t ae_max_jfiles = 0; + const u_int32_t jfsize_sblks = 128; + + args a("a5"); + a.recover_mode = true; + using mrg::jtt::test_case; + test_case::shared_ptr p(new test_case(6, 0, 0, 0, false, 0, 0, test_case::JTT_PERSISTNET, test_case::JDL_INTERNAL, + "t6")); + jrnl_init_params::shared_ptr jpp(new jrnl_init_params(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks)); + jrnl_instance ji(jpp); + ji.init_tc(p, &a); + ji.run_tc(); + ji.tc_wait_compl(); + try { jdir::verify_dir(jdir, bfn); } + catch (const jexception& e) { BOOST_ERROR(e.what()); } + jdir::delete_dir(jdir); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_SUITE_END() + Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_read_arg.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_read_arg.cpp?rev=1530301&view=auto ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_read_arg.cpp (added) +++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_read_arg.cpp Tue Oct 8 15:09:00 2013 @@ -0,0 +1,146 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +#include "../../unit_test.h" +#include +#include "read_arg.h" +#include + +#include +namespace po = boost::program_options; +using namespace mrg::jtt; +using namespace boost::unit_test; +using namespace std; + +QPID_AUTO_TEST_SUITE(jtt_read_arg) + +const string test_filename("_ut_read_arg"); + +QPID_AUTO_TEST_CASE(constructor) +{ + cout << test_filename << ".constructor: " << flush; + read_arg ra1; + BOOST_CHECK_EQUAL(ra1.val(), read_arg::NONE); + BOOST_CHECK_EQUAL(ra1.str(), "NONE"); + read_arg ra2(read_arg::NONE); + BOOST_CHECK_EQUAL(ra2.val(), read_arg::NONE); + BOOST_CHECK_EQUAL(ra2.str(), "NONE"); + read_arg ra3(read_arg::ALL); + BOOST_CHECK_EQUAL(ra3.val(), read_arg::ALL); + BOOST_CHECK_EQUAL(ra3.str(), "ALL"); + read_arg ra4(read_arg::RANDOM); + BOOST_CHECK_EQUAL(ra4.val(), read_arg::RANDOM); + BOOST_CHECK_EQUAL(ra4.str(), "RANDOM"); + read_arg ra5(read_arg::LAZYLOAD); + BOOST_CHECK_EQUAL(ra5.val(), read_arg::LAZYLOAD); + BOOST_CHECK_EQUAL(ra5.str(), "LAZYLOAD"); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(set_val) +{ + cout << test_filename << ".set_val: " << flush; + read_arg ra; + BOOST_CHECK_EQUAL(ra.val(), read_arg::NONE); + BOOST_CHECK_EQUAL(ra.str(), "NONE"); + ra.set_val(read_arg::ALL); + BOOST_CHECK_EQUAL(ra.val(), read_arg::ALL); + BOOST_CHECK_EQUAL(ra.str(), "ALL"); + ra.set_val(read_arg::RANDOM); + BOOST_CHECK_EQUAL(ra.val(), read_arg::RANDOM); + BOOST_CHECK_EQUAL(ra.str(), "RANDOM"); + ra.set_val(read_arg::LAZYLOAD); + BOOST_CHECK_EQUAL(ra.val(), read_arg::LAZYLOAD); + BOOST_CHECK_EQUAL(ra.str(), "LAZYLOAD"); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(parse) +{ + cout << test_filename << ".parse: " << flush; + read_arg ra; + ra.parse("LAZYLOAD"); + BOOST_CHECK_EQUAL(ra.val(), read_arg::LAZYLOAD); + BOOST_CHECK_EQUAL(ra.str(), "LAZYLOAD"); + ra.parse("ALL"); + BOOST_CHECK_EQUAL(ra.val(), read_arg::ALL); + BOOST_CHECK_EQUAL(ra.str(), "ALL"); + BOOST_CHECK_THROW(ra.parse(""), po::invalid_option_value) + BOOST_CHECK_EQUAL(ra.val(), read_arg::ALL); + BOOST_CHECK_EQUAL(ra.str(), "ALL"); + BOOST_CHECK_THROW(ra.parse("abc123"), po::invalid_option_value) + BOOST_CHECK_EQUAL(ra.val(), read_arg::ALL); + BOOST_CHECK_EQUAL(ra.str(), "ALL"); + ra.parse("NONE"); + BOOST_CHECK_EQUAL(ra.val(), read_arg::NONE); + BOOST_CHECK_EQUAL(ra.str(), "NONE"); + ra.parse("RANDOM"); + BOOST_CHECK_EQUAL(ra.val(), read_arg::RANDOM); + BOOST_CHECK_EQUAL(ra.str(), "RANDOM"); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(istream_) +{ + cout << test_filename << ".istream_: " << flush; + read_arg ra; + istringstream ss1("LAZYLOAD", ios::in); + ss1 >> ra; + BOOST_CHECK_EQUAL(ra.val(), read_arg::LAZYLOAD); + BOOST_CHECK_EQUAL(ra.str(), "LAZYLOAD"); + istringstream ss2("ALL", ios::in); + ss2 >> ra; + BOOST_CHECK_EQUAL(ra.val(), read_arg::ALL); + BOOST_CHECK_EQUAL(ra.str(), "ALL"); + istringstream ss3("NONE", ios::in); + ss3 >> ra; + BOOST_CHECK_EQUAL(ra.val(), read_arg::NONE); + BOOST_CHECK_EQUAL(ra.str(), "NONE"); + istringstream ss4("RANDOM", ios::in); + ss4 >> ra; + BOOST_CHECK_EQUAL(ra.val(), read_arg::RANDOM); + BOOST_CHECK_EQUAL(ra.str(), "RANDOM"); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(ostream_) +{ + cout << test_filename << ".ostream_: " << flush; + ostringstream s1; + read_arg ra(read_arg::LAZYLOAD); + s1 << ra; + BOOST_CHECK_EQUAL(s1.str(), "LAZYLOAD"); + ra.set_val(read_arg::ALL); + ostringstream s2; + s2 << ra; + BOOST_CHECK_EQUAL(s2.str(), "ALL"); + ra.set_val(read_arg::NONE); + ostringstream s3; + s3 << ra; + BOOST_CHECK_EQUAL(s3.str(), "NONE"); + ra.set_val(read_arg::RANDOM); + ostringstream s4; + s4 << ra; + BOOST_CHECK_EQUAL(s4.str(), "RANDOM"); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_SUITE_END() Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case.cpp?rev=1530301&view=auto ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case.cpp (added) +++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case.cpp Tue Oct 8 15:09:00 2013 @@ -0,0 +1,113 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +#include "../../unit_test.h" +#include +#include +#include +#include "test_case.h" +#include "test_case_result.h" + +using namespace boost::unit_test; +using namespace mrg::jtt; +using namespace std; + +QPID_AUTO_TEST_SUITE(jtt_test_case) + +const string test_filename("_ut_test_case"); + +QPID_AUTO_TEST_CASE(constructor) +{ + cout << test_filename << ".constructor: " << flush; + const unsigned test_case_num = 0x12345; + const u_int32_t num_msgs = 0x100; + const std::size_t min_data_size = 0x1000; + const std::size_t max_data_size = 0; + const bool auto_deq = true; + const std::size_t min_xid_size = 0x200; + const std::size_t max_xid_size = 0x200; + using mrg::jtt::test_case; + const test_case::transient_t transient = test_case::JTT_PERSISTNET; + const test_case::external_t external = test_case::JDL_INTERNAL; + const string comment = "This is a test"; + + test_case tc(test_case_num, num_msgs, min_data_size, max_data_size, auto_deq, + min_xid_size, max_xid_size, transient, external, comment); + BOOST_CHECK_EQUAL(tc.test_case_num(), test_case_num); + BOOST_CHECK_EQUAL(tc.num_msgs(), num_msgs); + BOOST_CHECK_EQUAL(tc.min_data_size(), min_data_size); + BOOST_CHECK_EQUAL(tc.max_data_size(), max_data_size); + BOOST_CHECK_EQUAL(tc.auto_deq(), auto_deq); + BOOST_CHECK_EQUAL(tc.min_xid_size(), min_xid_size); + BOOST_CHECK_EQUAL(tc.max_xid_size(), max_xid_size); + BOOST_CHECK_EQUAL(tc.transient(), transient); + BOOST_CHECK_EQUAL(tc.external(), external); + BOOST_CHECK_EQUAL(tc.comment(), comment); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(results) +{ + cout << test_filename << ".results: " << flush; + const unsigned test_case_num = 0x12345; + const u_int32_t num_msgs = 0x100; + const std::size_t min_data_size = 0x1000; + const std::size_t max_data_size = 0; + const bool auto_deq = true; + const std::size_t min_xid_size = 0x200; + const std::size_t max_xid_size = 0x200; + using mrg::jtt::test_case; + const test_case::transient_t transient = test_case::JTT_PERSISTNET; + const test_case::external_t external = test_case::JDL_INTERNAL; + const string comment = "This is a test"; + const unsigned num_results = 20; + + test_case tc(test_case_num, num_msgs, min_data_size, max_data_size, auto_deq, + min_xid_size, max_xid_size, transient, external, comment); + for (unsigned i=0; ijid(), oss.str()); + } + for (unsigned i=0; ijid(), oss.str()); + } + tc.clear(); + BOOST_CHECK_EQUAL(tc.num_results(), unsigned(0)); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_SUITE_END() Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_result.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_result.cpp?rev=1530301&view=auto ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_result.cpp (added) +++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_result.cpp Tue Oct 8 15:09:00 2013 @@ -0,0 +1,206 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +#include "../../unit_test.h" + +#include +#include "qpid/legacystore/jrnl/jexception.h" +#include "test_case_result.h" + +using namespace boost::unit_test; +using namespace mrg::journal; +using namespace mrg::jtt; +using namespace std; + +QPID_AUTO_TEST_SUITE(jtt_test_case_result) + +const string test_filename("_ut_test_case_result"); + +QPID_AUTO_TEST_CASE(constructor) +{ + cout << test_filename << ".constructor: " << flush; + const string jid("journal id 1"); + test_case_result tcr(jid); + BOOST_CHECK_EQUAL(tcr.jid(), jid); + BOOST_CHECK_EQUAL(tcr.exception(), false); + BOOST_CHECK_EQUAL(tcr.exception_count(), 0U); + const time_ns& ts1 = tcr.start_time(); + BOOST_CHECK(ts1.is_zero()); + const time_ns& ts2 = tcr.stop_time(); + BOOST_CHECK(ts2.is_zero()); + const time_ns& ts3 = tcr.test_time(); + BOOST_CHECK(ts3.is_zero()); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(start_stop) +{ + cout << test_filename << ".start_stop: " << flush; + const string jid("journal id 2"); + test_case_result tcr(jid); + BOOST_CHECK_EQUAL(tcr.exception(), false); + BOOST_CHECK_EQUAL(tcr.exception_count(), 0U); + const time_ns& ts1 = tcr.start_time(); + BOOST_CHECK(ts1.is_zero()); + const time_ns& ts2 = tcr.stop_time(); + BOOST_CHECK(ts2.is_zero()); + const time_ns& ts3 = tcr.test_time(); + BOOST_CHECK(ts3.is_zero()); + + tcr.set_start_time(); + BOOST_CHECK_EQUAL(tcr.exception(), false); + BOOST_CHECK_EQUAL(tcr.exception_count(), 0U); + const time_ns& ts4 = tcr.start_time(); + BOOST_CHECK(!ts4.is_zero()); + const time_ns& ts5 = tcr.stop_time(); + BOOST_CHECK(ts5.is_zero()); + const time_ns& ts6 = tcr.test_time(); + BOOST_CHECK(ts6.is_zero()); + + ::usleep(1100000); // 1.1 sec in microseconds + tcr.set_stop_time(); + BOOST_CHECK_EQUAL(tcr.exception(), false); + BOOST_CHECK_EQUAL(tcr.exception_count(), 0U); + const time_ns& ts7 = tcr.stop_time(); + BOOST_CHECK(!ts7.is_zero()); + const time_ns& ts8 = tcr.test_time(); + BOOST_CHECK(ts8.tv_sec == 1); + BOOST_CHECK(ts8.tv_nsec > 100000000); // 0.1 sec in nanoseconds + BOOST_CHECK(ts8.tv_nsec < 200000000); // 0.2 sec in nanoseconds + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(start_exception_stop_1) +{ + cout << test_filename << ".start_exception_stop_1: " << flush; + const string jid("journal id 3"); + test_case_result tcr(jid); + const u_int32_t err_code = 0x321; + const string err_msg = "exception message"; + const jexception e(err_code, err_msg); + tcr.set_start_time(); + ::usleep(1100000); // 1.1 sec in microseconds + tcr.add_exception(e); + BOOST_CHECK_EQUAL(tcr.exception(), true); + BOOST_CHECK_EQUAL(tcr.exception_count(), 1U); + BOOST_CHECK_EQUAL(tcr[0], e.what()); + const time_ns& ts1 = tcr.stop_time(); + BOOST_CHECK(!ts1.is_zero()); + const time_ns& ts2 = tcr.test_time(); + BOOST_CHECK(ts2.tv_sec == 1); + BOOST_CHECK(ts2.tv_nsec > 100000000); // 0.1 sec in nanoseconds + BOOST_CHECK(ts2.tv_nsec < 200000000); // 0.2 sec in nanoseconds + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(start_exception_stop_2) +{ + cout << test_filename << ".start_exception_stop_2: " << flush; + const string jid("journal id 4"); + test_case_result tcr(jid); + const string err_msg = "exception message"; + tcr.set_start_time(); + ::usleep(1100000); // 1.1 sec in microseconds + tcr.add_exception(err_msg); + BOOST_CHECK_EQUAL(tcr.exception(), true); + BOOST_CHECK_EQUAL(tcr.exception_count(), 1U); + BOOST_CHECK_EQUAL(tcr[0], err_msg); + const time_ns& ts1 = tcr.stop_time(); + BOOST_CHECK(!ts1.is_zero()); + const time_ns& ts2 = tcr.test_time(); + BOOST_CHECK(ts2.tv_sec == 1); + BOOST_CHECK(ts2.tv_nsec > 100000000); // 0.1 sec in nanoseconds + BOOST_CHECK(ts2.tv_nsec < 200000000); // 0.2 sec in nanoseconds + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(start_exception_stop_3) +{ + cout << test_filename << ".start_exception_stop_3: " << flush; + const string jid("journal id 5"); + test_case_result tcr(jid); + const char* err_msg = "exception message"; + tcr.set_start_time(); + ::usleep(1100000); // 1.1 sec in microseconds + tcr.add_exception(err_msg); + BOOST_CHECK_EQUAL(tcr.exception(), true); + BOOST_CHECK_EQUAL(tcr.exception_count(), 1U); + BOOST_CHECK_EQUAL(tcr[0], err_msg); + const time_ns& ts1 = tcr.stop_time(); + BOOST_CHECK(!ts1.is_zero()); + const time_ns& ts2 = tcr.test_time(); + BOOST_CHECK(ts2.tv_sec == 1); + BOOST_CHECK(ts2.tv_nsec > 100000000); // 0.1 sec in nanoseconds + BOOST_CHECK(ts2.tv_nsec < 200000000); // 0.2 sec in nanoseconds + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(start_exception) +{ + cout << test_filename << ".start_exception: " << flush; + const string jid("journal id 6"); + test_case_result tcr(jid); + u_int32_t err_code = 0x654; + const string err_msg = "exception message"; + const jexception e(err_code, err_msg); + tcr.set_start_time(); + ::usleep(1100000); // 1.1 sec in microseconds + tcr.add_exception(e, false); + BOOST_CHECK_EQUAL(tcr.exception(), true); + BOOST_CHECK_EQUAL(tcr.exception_count(), 1U); + BOOST_CHECK_EQUAL(tcr[0], e.what()); + const time_ns& ts1 = tcr.stop_time(); + BOOST_CHECK(ts1.is_zero()); + const time_ns& ts2 = tcr.test_time(); + BOOST_CHECK(ts2.is_zero()); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(counters) +{ + cout << test_filename << ".counters: " << flush; + const u_int32_t num_enq = 125; + const u_int32_t num_deq = 64; + const u_int32_t num_read = 22; + const string jid("journal id 7"); + test_case_result tcr(jid); + BOOST_CHECK_EQUAL(tcr.num_enq(), u_int32_t(0)); + BOOST_CHECK_EQUAL(tcr.num_deq(), u_int32_t(0)); + BOOST_CHECK_EQUAL(tcr.num_read(), u_int32_t(0)); + for (unsigned i=0; i +#include +#include "test_case_result_agregation.h" + +using namespace boost::unit_test; +using namespace mrg::journal; +using namespace mrg::jtt; +using namespace std; + +QPID_AUTO_TEST_SUITE(jtt_test_case_result_agregation) + +const string test_filename("_ut_test_case_result_agregation"); + +// === Helper functions === + +void check_agregate(const test_case_result_agregation& tcra, const u_int32_t num_enq, + const u_int32_t num_deq, const u_int32_t num_reads, const u_int32_t num_results, + const u_int32_t num_exceptions, const std::time_t secs, const long nsec) +{ + BOOST_CHECK_EQUAL(tcra.num_enq(), num_enq); + BOOST_CHECK_EQUAL(tcra.num_deq(), num_deq); + BOOST_CHECK_EQUAL(tcra.num_read(), num_reads); + BOOST_CHECK_EQUAL(tcra.num_results(), num_results); + BOOST_CHECK_EQUAL(tcra.exception_count(), num_exceptions); + BOOST_CHECK_EQUAL(tcra.exception(), num_exceptions > 0); + const time_ns& ts1 = tcra.test_time(); + BOOST_CHECK_EQUAL(ts1.tv_sec, secs); + BOOST_CHECK_EQUAL(ts1.tv_nsec, nsec); +} + +test_case_result::shared_ptr make_result(const string& jid, const u_int32_t num_enq, + const u_int32_t num_deq, const u_int32_t num_reads, const std::time_t secs, const long nsec) +{ + test_case_result::shared_ptr tcrp(new test_case_result(jid)); + for (unsigned i=0; iincr_num_enq(); + for (unsigned i=0; iincr_num_deq(); + for (unsigned i=0; iincr_num_read(); + time_ns ts(secs, nsec); + tcrp->set_test_time(ts); + return tcrp; +} + +// === Test suite === + +QPID_AUTO_TEST_CASE(constructor_1) +{ + cout << test_filename << ".constructor_1: " << flush; + test_case_result_agregation tcra; + BOOST_CHECK_EQUAL(tcra.tc_average_mode(), true); + BOOST_CHECK_EQUAL(tcra.jid(), "Average"); + BOOST_CHECK_EQUAL(tcra.exception(), false); + BOOST_CHECK_EQUAL(tcra.exception_count(), 0U); + const time_ns& ts1 = tcra.start_time(); + BOOST_CHECK(ts1.is_zero()); + const time_ns& ts2 = tcra.stop_time(); + BOOST_CHECK(ts2.is_zero()); + const time_ns& ts3 = tcra.test_time(); + BOOST_CHECK(ts3.is_zero()); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(constructor_2) +{ + cout << test_filename << ".constructor_2: " << flush; + string jid("journal id"); + test_case_result_agregation tcra(jid); + BOOST_CHECK_EQUAL(tcra.tc_average_mode(), false); + BOOST_CHECK_EQUAL(tcra.jid(), jid); + BOOST_CHECK_EQUAL(tcra.exception(), false); + BOOST_CHECK_EQUAL(tcra.exception_count(), 0U); + const time_ns& ts1 = tcra.start_time(); + BOOST_CHECK(ts1.is_zero()); + const time_ns& ts2 = tcra.stop_time(); + BOOST_CHECK(ts2.is_zero()); + const time_ns& ts3 = tcra.test_time(); + BOOST_CHECK(ts3.is_zero()); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(add_test_case) +{ + cout << test_filename << ".add_test_case: " << flush; + string jid("jid1"); + test_case_result::shared_ptr tcrp1 = make_result("jid1", 10, 10, 0, 1, 101010101L); + test_case_result::shared_ptr tcrp2 = make_result("jid1", 25, 0, 35, 10, 20202020L); + test_case_result::shared_ptr tcrp3 = make_result("jid1", 0, 15, 5, 2, 555555555L); + test_case_result::shared_ptr tcrp4 = make_result("jid2", 100, 100, 100, 100, 323232324L); + test_case_result::shared_ptr tcrp5 = make_result("jid1", 5, 0, 0, 0, 100L); + tcrp5->add_exception(string("error 1"), false); + test_case_result::shared_ptr tcrp6 = make_result("jid3", 0, 5, 0, 0, 100L); + jexception e(0x123, "exception 2"); + tcrp6->add_exception(e, false); + test_case_result::shared_ptr tcrp7 = make_result("jid1", 0, 0, 0, 0, 0L); + test_case_result::shared_ptr tcrp8 = make_result("jid1", 200, 100, 300, 12, 323232224L); + + test_case_result_agregation tcra(jid); + check_agregate(tcra, 0, 0, 0, 0, 0, 0, 0L); + tcra.add_test_result(tcrp1); + check_agregate(tcra, 10, 10, 0, 1, 0, 1, 101010101L); + tcra.add_test_result(tcrp2); + check_agregate(tcra, 35, 10, 35, 2, 0, 11, 121212121L); + tcra.add_test_result(tcrp3); + check_agregate(tcra, 35, 25, 40, 3, 0, 13, 676767676L); + tcra.add_test_result(tcrp4); + check_agregate(tcra, 35, 25, 40, 3, 0, 13, 676767676L); + tcra.add_test_result(tcrp5); + check_agregate(tcra, 40, 25, 40, 4, 1, 13, 676767776L); + tcra.add_test_result(tcrp6); + check_agregate(tcra, 40, 25, 40, 4, 1, 13, 676767776L); + tcra.add_test_result(tcrp7); + check_agregate(tcra, 40, 25, 40, 5, 1, 13, 676767776L); + tcra.add_test_result(tcrp8); + check_agregate(tcra, 240, 125, 340, 6, 1, 26, 0L); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(add_test_case_average) +{ + cout << test_filename << ".add_test_case_average: " << flush; + test_case_result::shared_ptr tcrp1 = make_result("jid1", 10, 10, 0, 1, 101010101L); + test_case_result::shared_ptr tcrp2 = make_result("jid2", 25, 0, 35, 10, 20202020L); + test_case_result::shared_ptr tcrp3 = make_result("jid3", 0, 15, 5, 2, 555555555L); + test_case_result::shared_ptr tcrp4 = make_result("jid4", 100, 100, 100, 100, 323232324L); + test_case_result::shared_ptr tcrp5 = make_result("jid5", 5, 0, 0, 0, 100L); + tcrp5->add_exception(string("error 1"), false); + test_case_result::shared_ptr tcrp6 = make_result("jid6", 0, 5, 0, 0, 100L); + jexception e(0x123, "exception 2"); + tcrp6->add_exception(e, false); + test_case_result::shared_ptr tcrp7 = make_result("jid7", 0, 0, 0, 0, 0L); + test_case_result::shared_ptr tcrp8 = make_result("jid8", 200, 100, 300, 12, 222222022L); + + test_case_result_agregation tcra; + check_agregate(tcra, 0, 0, 0, 0, 0, 0, 0L); + tcra.add_test_result(tcrp1); + check_agregate(tcra, 10, 10, 0, 1, 0, 1, 101010101L); + tcra.add_test_result(tcrp2); + check_agregate(tcra, 35, 10, 35, 2, 0, 11, 121212121L); + tcra.add_test_result(tcrp3); + check_agregate(tcra, 35, 25, 40, 3, 0, 13, 676767676L); + tcra.add_test_result(tcrp4); + check_agregate(tcra, 135, 125, 140, 4, 0, 114, 0L); + tcra.add_test_result(tcrp5); + check_agregate(tcra, 140, 125, 140, 5, 1, 114, 100L); + tcra.add_test_result(tcrp6); + check_agregate(tcra, 140, 130, 140, 6, 2, 114, 200L); + tcra.add_test_result(tcrp7); + check_agregate(tcra, 140, 130, 140, 7, 2, 114, 200L); + tcra.add_test_result(tcrp8); + check_agregate(tcra, 340, 230, 440, 8, 2, 126, 222222222L); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_SUITE_END() Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.cpp?rev=1530301&view=auto ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.cpp (added) +++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.cpp Tue Oct 8 15:09:00 2013 @@ -0,0 +1,147 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +#include "../../unit_test.h" +#include +#include +#include +#include "test_case.h" +#include "test_case_set.h" + +using namespace boost::unit_test; +using namespace mrg::jtt; +using namespace std; + +QPID_AUTO_TEST_SUITE(jtt_test_case_set) + +const string csv_file("_ut_test_case_set.csv"); +const string test_filename("_ut_test_case_set"); + +// === Helper functions === + +bool check_csv_file(const char* filename) +{ + struct stat s; + if (::stat(filename, &s)) + return false; + if (S_ISREG(s.st_mode)) + return true; + return false; +} + +// === Test suite === + +QPID_AUTO_TEST_CASE(constructor) +{ + cout << test_filename << ".constructor: " << flush; + test_case_set tcs; + BOOST_CHECK(tcs.empty()); + BOOST_CHECK_EQUAL(tcs.size(), unsigned(0)); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(append_1) +{ + cout << test_filename << ".append_1: " << flush; + const unsigned test_case_num = 0x12345; + const u_int32_t num_msgs = 0x100; + const std::size_t min_data_size = 0x1000; + const std::size_t max_data_size = 0; + const bool auto_deq = true; + const std::size_t min_xid_size = 0x200; + const std::size_t max_xid_size = 0x200; + using mrg::jtt::test_case; + const test_case::transient_t transient = test_case::JTT_PERSISTNET; + const test_case::external_t external = test_case::JDL_INTERNAL; + const string comment = "This is a test"; + + test_case_set tcs; + tcs.append(test_case_num, num_msgs, min_data_size, max_data_size, auto_deq, min_xid_size, + max_xid_size, transient, external, comment); + BOOST_CHECK(!tcs.empty()); + BOOST_CHECK_EQUAL(tcs.size(), unsigned(1)); + test_case::shared_ptr tcp = tcs[0]; + BOOST_CHECK_EQUAL(tcp->test_case_num(), test_case_num); + BOOST_CHECK_EQUAL(tcp->num_msgs(), num_msgs); + BOOST_CHECK_EQUAL(tcp->min_data_size(), min_data_size); + BOOST_CHECK_EQUAL(tcp->max_data_size(), max_data_size); + BOOST_CHECK_EQUAL(tcp->min_xid_size(), min_xid_size); + BOOST_CHECK_EQUAL(tcp->max_xid_size(), max_xid_size); + BOOST_CHECK_EQUAL(tcp->transient(), transient); + BOOST_CHECK_EQUAL(tcp->external(), external); + BOOST_CHECK_EQUAL(tcp->comment(), comment); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(append_2) +{ + cout << test_filename << ".append_2: " << flush; + const unsigned test_case_num = 0x12345; + const u_int32_t num_msgs = 0x100; + const std::size_t min_data_size = 0x1000; + const std::size_t max_data_size = 0; + const bool auto_deq = true; + const std::size_t min_xid_size = 0x200; + const std::size_t max_xid_size = 0x200; + using mrg::jtt::test_case; + const test_case::transient_t transient = test_case::JTT_PERSISTNET; + const test_case::external_t external = test_case::JDL_INTERNAL; + const string comment = "This is a test"; + + test_case::shared_ptr tcp(new test_case(test_case_num, num_msgs, min_data_size, max_data_size, + auto_deq, min_xid_size, max_xid_size, transient, external, comment)); + test_case_set tcs; + tcs.append(tcp); + BOOST_CHECK(!tcs.empty()); + BOOST_CHECK_EQUAL(tcs.size(), unsigned(1)); + tcp = tcs[0]; + BOOST_CHECK_EQUAL(tcp->test_case_num(), test_case_num); + BOOST_CHECK_EQUAL(tcp->num_msgs(), num_msgs); + BOOST_CHECK_EQUAL(tcp->min_data_size(), min_data_size); + BOOST_CHECK_EQUAL(tcp->max_data_size(), max_data_size); + BOOST_CHECK_EQUAL(tcp->min_xid_size(), min_xid_size); + BOOST_CHECK_EQUAL(tcp->max_xid_size(), max_xid_size); + BOOST_CHECK_EQUAL(tcp->transient(), transient); + BOOST_CHECK_EQUAL(tcp->external(), external); + BOOST_CHECK_EQUAL(tcp->comment(), comment); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_CASE(append_from_csv) +{ + cout << test_filename << ".append_from_csv: " << flush; + test_case_set tcs; + BOOST_REQUIRE_MESSAGE(check_csv_file(csv_file.c_str()), "Test CSV file \"" << csv_file << + "\" is missing."); + tcs.append_from_csv(csv_file, false); + BOOST_CHECK(!tcs.empty()); + BOOST_CHECK_EQUAL(tcs.size(), unsigned(44)); + BOOST_CHECK_EQUAL(tcs.ignored(), unsigned(0)); + tcs.clear(); + BOOST_CHECK(tcs.empty()); + tcs.append_from_csv(csv_file, true); + BOOST_CHECK(!tcs.empty()); + BOOST_CHECK_EQUAL(tcs.size(), unsigned(18)); + BOOST_CHECK_EQUAL(tcs.ignored(), unsigned(26)); + cout << "ok" << endl; +} + +QPID_AUTO_TEST_SUITE_END() Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.csv URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.csv?rev=1530301&view=auto ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.csv (added) +++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.csv Tue Oct 8 15:09:00 2013 @@ -0,0 +1,74 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +,,,,,,,"Msg size",,"Xid size",,,,,"enq-size",,"deq-size",,"txn-size",, +"Col. 0","1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20" +"Test #","tf","pf","amn","mn incr","#msgs","ms incr","Min","Max","Min","Max","auto-deq","transient","extern","bytes","dblks","bytes","dblks","bytes","dblks","comment" +,,,,,,,,,,,,,,,,,,,, +"Initialize only",,,,,,,,,,,,,,,,,,,, +0,"L",0,0,0,0,0,0,0,0,0,FALSE,FALSE,FALSE,44,1,0,0,0,0,"No messages - journal creation/initialization only" +,,,,,,,,,,,,,,,,,,,, +"Simple message combinations of persistent/deq transientueued/non-dequeued, transactional/non-transactional",,,,,,,,,,,,,,,,,,,, +1,"L",1,1,0,1,0,10,10,0,0,FALSE,FALSE,FALSE,54,1,0,0,0,0,"1 * 10-byte message" +2,"L",1,10,0,10,0,10,10,0,0,FALSE,FALSE,FALSE,54,1,0,0,0,0,"10 * 10-byte message" +3,"L",1,1,0,1,0,10,10,0,0,FALSE,TRUE,FALSE,54,1,0,0,0,0,"1 * 10-byte message [transient]" +4,"L",1,10,0,10,0,10,10,0,0,FALSE,TRUE,FALSE,54,1,0,0,0,0,"10 * 10-byte message [transient]" +5,"L",1,1,0,1,0,10,10,10,10,FALSE,FALSE,FALSE,64,1,0,0,0,0,"1 * 10-byte message [txn]" +6,"L",1,10,0,10,0,10,10,10,10,FALSE,FALSE,FALSE,64,1,0,0,0,0,"10 * 10-byte message [txn]" +7,"L",1,1,0,1,0,10,10,10,10,FALSE,TRUE,FALSE,64,1,0,0,0,0,"1 * 10-byte message [txn transient]" +8,"L",1,10,0,10,0,10,10,10,10,FALSE,TRUE,FALSE,64,1,0,0,0,0,"10 * 10-byte message [txn transient]" +9,"L",1,1,0,1,0,10,10,0,0,TRUE,FALSE,FALSE,54,1,32,1,0,0,"1 * 10-byte message [deq]" +10,"L",1,10,0,10,0,10,10,0,0,TRUE,FALSE,FALSE,54,1,32,1,0,0,"10 * 10-byte message [deq]" +11,"L",1,1,0,1,0,10,10,0,0,TRUE,TRUE,FALSE,54,1,32,1,0,0,"1 * 10-byte message [deq transient]" +12,"L",1,10,0,10,0,10,10,0,0,TRUE,TRUE,FALSE,54,1,32,1,0,0,"10 * 10-byte message [deq transient]" +13,"L",1,1,0,1,0,10,10,10,10,TRUE,FALSE,FALSE,64,1,54,1,46,1,"1 * 10-byte message [deq txn]" +14,"L",1,10,0,10,0,10,10,10,10,TRUE,FALSE,FALSE,64,1,54,1,46,1,"10 * 10-byte message [deq txn]" +15,"L",1,1,0,1,0,10,10,10,10,TRUE,TRUE,FALSE,64,1,54,1,46,1,"1 * 10-byte message [txn deq transient]" +16,"L",1,10,0,10,0,10,10,10,10,TRUE,TRUE,FALSE,64,1,54,1,46,1,"10 * 10-byte message [txn deq transient]" +17,"L",1,1,0,1,0,10,10,0,0,FALSE,FALSE,TRUE,54,1,0,0,0,0,"1 * 10-byte message [extern]" +18,"L",1,10,0,10,0,10,10,0,0,FALSE,FALSE,TRUE,54,1,0,0,0,0,"10 * 10-byte message [extern]" +19,"L",1,1,0,1,0,10,10,0,0,FALSE,TRUE,TRUE,54,1,0,0,0,0,"1 * 10-byte message [transient extern]" +20,"L",1,10,0,10,0,10,10,0,0,FALSE,TRUE,TRUE,54,1,0,0,0,0,"10 * 10-byte message [transient extern]" +21,"L",1,1,0,1,0,10,10,10,10,FALSE,FALSE,TRUE,64,1,0,0,0,0,"1 * 10-byte message [txn extern]" +22,"L",1,10,0,10,0,10,10,10,10,FALSE,FALSE,TRUE,64,1,0,0,0,0,"10 * 10-byte message [txn extern]" +23,"L",1,1,0,1,0,10,10,10,10,FALSE,TRUE,TRUE,64,1,0,0,0,0,"1 * 10-byte message [txn transient extern]" +24,"L",1,10,0,10,0,10,10,10,10,FALSE,TRUE,TRUE,64,1,0,0,0,0,"10 * 10-byte message [txn transient extern]" +25,"L",1,1,0,1,0,10,10,0,0,TRUE,FALSE,TRUE,54,1,32,1,0,0,"1 * 10-byte message [deq extern]" +26,"L",1,10,0,10,0,10,10,0,0,TRUE,FALSE,TRUE,54,1,32,1,0,0,"10 * 10-byte message [deq extern]" +27,"L",1,1,0,1,0,10,10,0,0,TRUE,TRUE,TRUE,54,1,32,1,0,0,"1 * 10-byte message [deq transient extern]" +28,"L",1,10,0,10,0,10,10,0,0,TRUE,TRUE,TRUE,54,1,32,1,0,0,"10 * 10-byte message [deq transient extern]" +29,"L",1,1,0,1,0,10,10,10,10,TRUE,FALSE,TRUE,64,1,54,1,46,1,"1 * 10-byte message [deq txn extern]" +30,"L",1,10,0,10,0,10,10,10,10,TRUE,FALSE,TRUE,64,1,54,1,46,1,"10 * 10-byte message [deq txn extern]" +31,"L",1,1,0,1,0,10,10,10,10,TRUE,TRUE,TRUE,64,1,54,1,46,1,"1 * 10-byte message [txn deq transient extern]" +32,"L",1,10,0,10,0,10,10,10,10,TRUE,TRUE,TRUE,64,1,54,1,46,1,"10 * 10-byte message [txn deq transient extern]" +,,,,,,,,,,,,,,,,,,,, +"High volume tests of random message lengths - RHM_WRONLY req'd for auto-dequeue == FALSE",,,,,,,,,,,,,,,,,,,, +33,"M",1,5000000,0,5000000,0,0,100,1,100,FALSE,RANDOM,RANDOM,244,2,0,0,0,0,"100 bytes xid max + 100 bytes data max [txn]" +34,"M",3,3000000,0,3000000,0,0,300,1,300,FALSE,RANDOM,RANDOM,644,6,0,0,0,0,"300 bytes xid max + 300 bytes data max [txn]" +35,"M",10,1600000,0,1600000,0,0,1000,1,1000,FALSE,RANDOM,RANDOM,2044,16,0,0,0,0,"1000 bytes xid max + 1000 bytes data max [txn]" +36,"M",30,600000,0,600000,0,0,3000,1,3000,FALSE,RANDOM,RANDOM,6044,48,0,0,0,0,"3000 bytes xid max + 3000 bytes data max [txn]" +37,"M",100,200000,0,200000,0,0,10000,1,10000,FALSE,RANDOM,RANDOM,20044,157,0,0,0,0,"10000 bytes xid max + 10000 bytes data max [txn]" +38,"M",300,60000,0,60000,0,0,30000,1,30000,FALSE,RANDOM,RANDOM,60044,470,0,0,0,0,"30000 bytes xid max + 30000 bytes data max [txn]" +39,"M",1000,20000,0,20000,0,0,100000,1,100000,FALSE,RANDOM,RANDOM,200044,1563,0,0,0,0,"100000 bytes xid max + 100000 bytes data max [txn]" +,,,,,,,,,,,,,,,,,,,, +"STANDARD PERFORMANCE BENCHMARK: 10,000,000 writes, data=212b (2 dblks)",,,,,,,,,,,,,,,,,,,, +40,"M",1,10000000,0,10000000,0,212,212,0,0,FALSE,FALSE,FALSE,256,2,0,0,0,0,"212 bytes data (2 dblks enq)" +41,"M",1,10000000,0,10000000,0,148,148,64,64,FALSE,FALSE,FALSE,256,2,0,0,0,0,"148 bytes data + 64 bytes xid (2 dblks enq)" +42,"M",1,10000000,0,10000000,0,212,212,0,0,TRUE,FALSE,FALSE,256,2,32,1,0,0,"212 bytes data (2 dblks enq + 1 dblk deq)" +43,"M",1,10000000,0,10000000,0,148,148,64,64,TRUE,FALSE,FALSE,256,2,108,1,100,1,"148 bytes data + 64 bytes xid (2 dblks enq + 1 dblks deq + 1 dblks txn)" --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org