Ticket #259: patch

File patch, 612 bytes (added by Richard Boulton, 16 years ago)

Testcase which reproduces the problem

  • tests/api_wrdb.cc

     
    21042104
    21052105    return true;
    21062106}
     2107
     2108/// Regression test of reading after writing but not flushing.
     2109DEFINE_TESTCASE(writeread1, writable && metadata) {
     2110    Xapian::WritableDatabase db_w = get_writable_database();
     2111    db_w.set_metadata("1", "2");
     2112    string longitem(20000, 'j');
     2113    db_w.set_metadata("2", longitem);
     2114
     2115    string readitem = db_w.get_metadata("2");
     2116    TEST_EQUAL(readitem, longitem);
     2117
     2118    return true;
     2119}