tests/api_closedb.cc File Reference

Tests of closing databases. More...

#include <config.h>
#include "api_closedb.h"
#include <xapian.h>
#include "apitest.h"
#include "testutils.h"

Include dependency graph for api_closedb.cc:

Go to the source code of this file.

Classes

struct  closedb1_iterators

Defines

#define COUNT_CLOSEDEXC(CODE)   try { CODE; } catch (const Xapian::DatabaseError &) { ++closedexc_count; }
#define IF_NOT_CLOSEDEXC(CODE)

Functions

 DEFINE_TESTCASE (closedb1, backend)
 DEFINE_TESTCASE (closedb2, writable &&!inmemory &&!remote)
 DEFINE_TESTCASE (closedb3, backend)
 Check API methods which might either work or throw an exception.
 DEFINE_TESTCASE (closedb4, writable &&!inmemory)
 Regression test for bug fixed in 1.1.4 - close() should implicitly commit().
 DEFINE_TESTCASE (closedb5, transactions &&!remote)
 If a transaction is active, close() shouldn't implicitly commit().
 DEFINE_TESTCASE (closedb6, remote)
 Database::keep_alive() should fail after close() for a remote database.
 DEFINE_TESTCASE (closedb7, writable)
 DEFINE_TESTCASE (closedb8, writable &&spelling)
 DEFINE_TESTCASE (closedb9, writable &&synonyms)
 DEFINE_TESTCASE (closedb10, writable &&metadata)


Detailed Description

Tests of closing databases.

Definition in file api_closedb.cc.


Define Documentation

#define COUNT_CLOSEDEXC ( CODE   )     try { CODE; } catch (const Xapian::DatabaseError &) { ++closedexc_count; }

Definition at line 33 of file api_closedb.cc.

Referenced by closedb1_iterators::perform().

#define IF_NOT_CLOSEDEXC ( CODE   ) 

Value:

do { \
        hadexc = false; \
        try { \
            CODE; \
        } catch (const Xapian::DatabaseError &) { \
            ++closedexc_count; \
            hadexc = true; \
        } \
    } while (false); if (hadexc)

Definition at line 36 of file api_closedb.cc.

Referenced by closedb1_iterators::perform().


Function Documentation

DEFINE_TESTCASE ( closedb10  ,
writable &&  metadata 
)

DEFINE_TESTCASE ( closedb9  ,
writable &&  synonyms 
)

DEFINE_TESTCASE ( closedb8  ,
writable &&  spelling 
)

DEFINE_TESTCASE ( closedb7  ,
writable   
)

DEFINE_TESTCASE ( closedb6  ,
remote   
)

Database::keep_alive() should fail after close() for a remote database.

Definition at line 250 of file api_closedb.cc.

References Xapian::Database::close(), get_database(), and Xapian::Database::keep_alive().

DEFINE_TESTCASE ( closedb5  ,
transactions &&!  remote 
)

DEFINE_TESTCASE ( closedb4  ,
writable &&!  inmemory 
)

Regression test for bug fixed in 1.1.4 - close() should implicitly commit().

Definition at line 212 of file api_closedb.cc.

References Xapian::WritableDatabase::add_document(), Xapian::Database::close(), Xapian::Database::get_doccount(), get_writable_database(), get_writable_database_as_database(), and TEST_EQUAL.

DEFINE_TESTCASE ( closedb3  ,
backend   
)

DEFINE_TESTCASE ( closedb2  ,
writable &&!inmemory &&!  remote 
)

DEFINE_TESTCASE ( closedb1  ,
backend   
)


Documentation for Xapian (version 1.2.13).
Generated on 9 Jan 2013 by Doxygen 1.5.9.