LCOV - code coverage report
Current view: top level - tests - api_replacedoc.cc (source / functions) Hit Total Coverage
Test: Test Coverage for xapian-core 954b5873a738 Lines: 149 149 100.0 %
Date: 2019-06-30 05:20:33 Functions: 4 4 100.0 %
Branches: 241 1264 19.1 %

           Branch data     Line data    Source code
       1                 :            : /** @file api_replacedoc.cc
       2                 :            :  * @brief tests of document replacing.
       3                 :            :  */
       4                 :            : /* Copyright 2009 Richard Boulton
       5                 :            :  * Copyright 2015,2016 Olly Betts
       6                 :            :  *
       7                 :            :  * This program is free software; you can redistribute it and/or
       8                 :            :  * modify it under the terms of the GNU General Public License as
       9                 :            :  * published by the Free Software Foundation; either version 2 of the
      10                 :            :  * License, or (at your option) any later version.
      11                 :            :  *
      12                 :            :  * This program is distributed in the hope that it will be useful,
      13                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      14                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      15                 :            :  * GNU General Public License for more details.
      16                 :            :  *
      17                 :            :  * You should have received a copy of the GNU General Public License
      18                 :            :  * along with this program; if not, write to the Free Software
      19                 :            :  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
      20                 :            :  * USA
      21                 :            :  */
      22                 :            : 
      23                 :            : #include <config.h>
      24                 :            : 
      25                 :            : #include "api_replacedoc.h"
      26                 :            : 
      27                 :            : #include <string>
      28                 :            : #include <map>
      29                 :            : 
      30                 :            : using namespace std;
      31                 :            : 
      32                 :            : #include <xapian.h>
      33                 :            : #include "testsuite.h"
      34                 :            : #include "testutils.h"
      35                 :            : 
      36                 :            : #include "apitest.h"
      37                 :            : #include "dbcheck.h"
      38                 :            : 
      39                 :            : // Test that positionlists are updated correctly.
      40                 :          5 : DEFINE_TESTCASE(poslistupdate1, positional && writable) {
      41 [ +  - ][ +  - ]:          5 :     Xapian::WritableDatabase db = get_writable_database();
      42                 :            : 
      43         [ +  - ]:         10 :     Xapian::Document doc;
      44 [ +  - ][ +  - ]:          5 :     doc.add_posting("pos", 2);
      45 [ +  - ][ +  - ]:          5 :     doc.add_posting("pos", 3);
      46         [ +  - ]:          5 :     db.add_document(doc);
      47         [ +  - ]:          5 :     db.commit();
      48                 :            : 
      49 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(pos, wdf=2, pos=[2, 3])");
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      50                 :            : 
      51 [ +  - ][ +  - ]:          5 :     doc = db.get_document(1);
      52 [ +  - ][ +  - ]:          5 :     doc.add_term("pos2");
      53         [ +  - ]:          5 :     db.replace_document(1, doc);
      54         [ +  - ]:          5 :     db.commit();
      55 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1),
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      56                 :            :                "Term(pos, wdf=2, pos=[2, 3]), "
      57                 :            :                "Term(pos2, wdf=1)");
      58                 :            : 
      59 [ +  - ][ +  - ]:          5 :     doc = db.get_document(1);
      60 [ +  - ][ +  - ]:          5 :     doc.add_posting("pos3", 1);
      61 [ +  - ][ +  - ]:          5 :     doc.add_posting("pos3", 5);
      62         [ +  - ]:          5 :     db.replace_document(1, doc);
      63         [ +  - ]:          5 :     db.commit();
      64 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1),
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      65                 :            :                "Term(pos, wdf=2, pos=[2, 3]), "
      66                 :            :                "Term(pos2, wdf=1), "
      67                 :            :                "Term(pos3, wdf=2, pos=[1, 5])");
      68                 :            : 
      69 [ +  - ][ +  - ]:          5 :     doc = db.get_document(1);
      70 [ +  - ][ +  - ]:          5 :     doc.remove_term("pos");
      71         [ +  - ]:          5 :     db.replace_document(1, doc);
      72         [ +  - ]:          5 :     db.commit();
      73 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1),
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      74                 :            :                "Term(pos2, wdf=1), "
      75                 :            :                "Term(pos3, wdf=2, pos=[1, 5])");
      76                 :            : 
      77                 :            :     // Regression test: the old positionlist fragment used to be left lying
      78                 :            :     // around here.
      79 [ +  - ][ +  - ]:         10 :     Xapian::PositionIterator posit(db.positionlist_begin(1, "pos"));
      80 [ +  - ][ -  + ]:          5 :     TEST(posit == db.positionlist_end(1, "pos"));
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
      81                 :            : 
      82 [ +  - ][ +  - ]:          5 :     doc = db.get_document(1);
      83 [ +  - ][ +  - ]:          5 :     doc.remove_term("pos3");
      84         [ +  - ]:          5 :     db.replace_document(1, doc);
      85         [ +  - ]:          5 :     db.commit();
      86 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1),
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      87                 :            :                "Term(pos2, wdf=1)");
      88                 :            : 
      89                 :            :     // Regression test: the old positionlist fragment used to be left lying
      90                 :            :     // around here.
      91 [ +  - ][ +  - ]:         10 :     Xapian::PositionIterator posit2(db.positionlist_begin(1, "pos3"));
      92 [ +  - ][ -  + ]:          5 :     TEST(posit2 == db.positionlist_end(1, "pos3"));
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
      93                 :            : 
      94 [ +  - ][ +  - ]:          5 :     doc = db.get_document(1);
      95 [ +  - ][ +  - ]:          5 :     doc.add_term("pos");
      96         [ +  - ]:          5 :     db.replace_document(1, doc);
      97         [ +  - ]:          5 :     db.commit();
      98 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1),
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      99                 :            :                "Term(pos, wdf=1), "
     100                 :            :                "Term(pos2, wdf=1)");
     101                 :            : 
     102                 :          5 :     return true;
     103                 :            : }
     104                 :            : 
     105                 :            : static Xapian::Document
     106                 :         40 : basic_doc() {
     107                 :         40 :     Xapian::Document doc;
     108 [ +  - ][ +  - ]:         40 :     doc.add_term("z0", 0);
     109 [ +  - ][ +  - ]:         40 :     doc.add_term("z1", 1);
     110                 :         40 :     return doc;
     111                 :            : }
     112                 :            : 
     113                 :            : static string
     114                 :          5 : basic_docterms() {
     115         [ +  - ]:          5 :     return ", Term(z0, wdf=0), Term(z1, wdf=1)";
     116                 :            : }
     117                 :            : 
     118                 :            : /** Check that changing the wdf of a term in a document works.
     119                 :            :  */
     120                 :          5 : DEFINE_TESTCASE(modtermwdf1, writable) {
     121 [ +  - ][ +  - ]:          5 :     Xapian::WritableDatabase db(get_writable_database());
     122                 :            : 
     123         [ +  - ]:         10 :     string bdt(basic_docterms());
     124                 :            : 
     125                 :            :     // Add a simple document.
     126         [ +  - ]:         10 :     Xapian::Document doc1(basic_doc());
     127 [ +  - ][ +  - ]:          5 :     doc1.add_term("takeaway", 1);
     128         [ +  - ]:          5 :     db.add_document(doc1);
     129                 :            : 
     130         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     131 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=1)" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     132                 :            : 
     133                 :            :     // Modify the wdf of an existing document, checking stats before commit.
     134         [ +  - ]:         10 :     Xapian::Document doc2(basic_doc());
     135 [ +  - ][ +  - ]:          5 :     doc2.add_term("takeaway", 2);
     136         [ +  - ]:          5 :     db.replace_document(1, doc2);
     137         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     138 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=2)" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     139                 :            : 
     140                 :            :     // Remove a term, and then put it back again.
     141         [ +  - ]:         10 :     Xapian::Document doc0(basic_doc());
     142         [ +  - ]:          5 :     db.replace_document(1, doc0);
     143         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     144 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), bdt.substr(2));
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     145         [ +  - ]:          5 :     db.replace_document(1, doc1);
     146         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     147 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=1)" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     148                 :            : 
     149                 :            :     // Remove a term, commit, then put it back, remove it, and put it back.
     150                 :            :     // This is to test the handling of items in the change cache.
     151         [ +  - ]:          5 :     db.replace_document(1, doc0);
     152         [ +  - ]:          5 :     db.commit();
     153         [ +  - ]:          5 :     db.replace_document(1, doc2);
     154         [ +  - ]:          5 :     db.replace_document(1, doc0);
     155         [ +  - ]:          5 :     db.replace_document(1, doc2);
     156         [ +  - ]:          5 :     db.commit();
     157         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     158 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=2)" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     159                 :            : 
     160                 :            :     // Remove a term, and then put it back again without checking stats.
     161         [ +  - ]:          5 :     db.replace_document(1, doc0);
     162         [ +  - ]:          5 :     db.replace_document(1, doc2);
     163         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     164 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=2)" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     165                 :            : 
     166                 :            :     // Modify a term, and then put it back again without checking stats.
     167         [ +  - ]:          5 :     db.replace_document(1, doc1);
     168         [ +  - ]:          5 :     db.replace_document(1, doc2);
     169         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     170 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=2)" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     171                 :            : 
     172                 :            :     // Modify the wdf of an existing document, checking stats after commit.
     173         [ +  - ]:         10 :     Xapian::Document doc3(basic_doc());
     174 [ +  - ][ +  - ]:          5 :     doc3.add_term("takeaway", 3);
     175         [ +  - ]:          5 :     db.replace_document(1, doc3);
     176         [ +  - ]:          5 :     db.commit();
     177         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     178 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=3)" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     179                 :            : 
     180                 :            :     // Change a document, without changing its length.
     181         [ +  - ]:         10 :     Xapian::Document doc3_diff(basic_doc());
     182 [ +  - ][ +  - ]:          5 :     doc3_diff.add_term("takeaways", 3);
     183         [ +  - ]:          5 :     db.replace_document(1, doc3_diff);
     184         [ +  - ]:          5 :     db.commit();
     185         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     186 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaways, wdf=3)" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     187                 :            : 
     188                 :            :     // Put it back.
     189         [ +  - ]:          5 :     db.replace_document(1, doc3);
     190         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     191 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=3)" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     192                 :            : 
     193                 :            :     // Modify a document taken from the database.
     194         [ +  - ]:         10 :     Xapian::Document doc4(db.get_document(1));
     195         [ +  - ]:         10 :     Xapian::Document doc3a(db.get_document(1)); // need this one later
     196 [ +  - ][ +  - ]:          5 :     doc3a.add_boolean_term("takeaway"); // Pull the document termlist into memory.
     197 [ +  - ][ +  - ]:          5 :     doc4.add_term("takeaway", 1);
     198         [ +  - ]:          5 :     db.replace_document(1, doc4);
     199         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     200 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=4)" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     201                 :            : 
     202                 :            :     // Add a document which was previously added and then modified.
     203 [ +  - ][ +  - ]:          5 :     doc1.add_term("takeaway", 1);
     204         [ +  - ]:          5 :     db.replace_document(1, doc1);
     205         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     206 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=2)" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     207                 :            : 
     208                 :            :     // Add back a document which was taken from the database, but never modified.
     209         [ +  - ]:          5 :     db.replace_document(1, doc3a);
     210         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     211 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=3)" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     212                 :            : 
     213                 :            :     // Add a position to the document.
     214         [ +  - ]:         10 :     Xapian::Document doc5(db.get_document(1));
     215 [ +  - ][ +  - ]:          5 :     doc5.add_posting("takeaway", 1, 2);
     216         [ +  - ]:          5 :     db.replace_document(1, doc5);
     217         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     218 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=5, pos=[1])" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     219                 :            : 
     220                 :            :     // Add a position without changing the wdf.
     221         [ +  - ]:         10 :     Xapian::Document doc5b(db.get_document(1));
     222 [ +  - ][ +  - ]:          5 :     doc5b.add_posting("takeaway", 2, 0);
     223         [ +  - ]:          5 :     db.replace_document(1, doc5b);
     224         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     225 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=5, pos=[1, 2])" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     226                 :            : 
     227                 :            :     // Delete a position without changing the wdf.
     228         [ +  - ]:         10 :     Xapian::Document doc5c(basic_doc());
     229 [ +  - ][ +  - ]:          5 :     doc5c.add_posting("takeaway", 2, 5);
     230         [ +  - ]:          5 :     db.replace_document(1, doc5c);
     231         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     232 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=5, pos=[2])" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     233                 :            : 
     234                 :            :     // Delete the other position without changing the wdf.
     235         [ +  - ]:         10 :     Xapian::Document doc5d(basic_doc());
     236 [ +  - ][ +  - ]:          5 :     doc5d.add_term("takeaway", 5);
     237         [ +  - ]:          5 :     db.replace_document(1, doc5d);
     238         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     239 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=5)" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     240                 :            : 
     241                 :            :     // Reduce the wdf to 0, but don't delete the term.
     242         [ +  - ]:         10 :     Xapian::Document doc0freq(basic_doc());
     243 [ +  - ][ +  - ]:          5 :     doc0freq.add_term("takeaway", 0);
     244         [ +  - ]:          5 :     db.replace_document(1, doc0freq);
     245         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     246 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), "Term(takeaway, wdf=0)" + bdt);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     247                 :            : 
     248                 :            :     // Reduce the wdf to 0, and delete the term.
     249         [ +  - ]:          5 :     db.replace_document(1, doc0);
     250         [ +  - ]:          5 :     dbcheck(db, 1, 1);
     251 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(docterms_to_string(db, 1), bdt.substr(2));
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     252                 :            : 
     253                 :            :     // Delete the document.
     254         [ +  - ]:          5 :     db.delete_document(1);
     255         [ +  - ]:          5 :     dbcheck(db, 0, 1);
     256 [ +  - ][ -  + ]:          5 :     TEST_EXCEPTION(Xapian::DocNotFoundError, docterms_to_string(db, 1));
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ -  +  
          #  #  #  #  #  
          #  #  #  #  #  
             #  #  #  # ]
                 [ +  - ]
     257 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(postlist_to_string(db, "takeaway"), "");
         [ +  - ][ -  +  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
             #  #  #  # ]
     258 [ +  - ][ -  +  :          5 :     TEST_EXCEPTION(Xapian::DocNotFoundError, docstats_to_string(db, 1));
          #  #  #  #  #  
          #  #  #  #  #  
           #  # ][ -  + ]
           [ -  +  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
           #  # ][ +  - ]
     259 [ +  - ][ +  - ]:          5 :     TEST_EQUAL(termstats_to_string(db, "takeaway"), "tf=0,cf=0");
         [ +  - ][ -  +  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
             #  #  #  # ]
     260 [ +  - ][ -  +  :          5 :     TEST_EQUAL(db.get_doccount(), 0);
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
                   #  # ]
     261 [ +  - ][ -  +  :          5 :     TEST_EQUAL(db.get_avlength(), 0);
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
                   #  # ]
     262 [ +  - ][ -  +  :          5 :     TEST_EQUAL(db.get_lastdocid(), 1);
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
                   #  # ]
     263                 :            : 
     264                 :          5 :     return true;
     265                 :            : }

Generated by: LCOV version 1.11