Ticket #232: patch

File patch, 807 bytes (added by Richard Boulton, 17 years ago)

Patch to testsuite to reproduce bug

  • tests/api_wrdb.cc

     
    18751875    return true;
    18761876}
    18771877
     1878// Regression test for adding a piece of metadata on its own before adding
     1879// other things.
     1880DEFINE_TESTCASE(metadata4, metadata) {
     1881    Xapian::WritableDatabase db = get_writable_database();
     1882
     1883    db.set_metadata("foo", "foo");
     1884    db.flush();
     1885
     1886    Xapian::Document doc;
     1887    doc.add_posting("foo", 1);
     1888    db.add_document(doc);
     1889
     1890    Xapian::Database dbr(get_writable_database_as_database());
     1891
     1892    return true;
     1893}
     1894
     1895
     1896
    18781897// Test that adding a document with a really long term gives an error on
    18791898// add_document() rather than on flush().
    18801899DEFINE_TESTCASE(termtoolong1, writable) {