remove TBD2::clear, only used in tests
This commit is contained in:
committed by
Tomas Babej
parent
271d06cd9c
commit
e3ef6c504a
12
src/TDB2.cpp
12
src/TDB2.cpp
@@ -1291,18 +1291,6 @@ size_t TDB2::data_size ()
|
|||||||
return pending._file.size () + completed._file.size () + undo._file.size () + backlog._file.size ();
|
return pending._file.size () + completed._file.size () + undo._file.size () + backlog._file.size ();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
void TDB2::clear ()
|
|
||||||
{
|
|
||||||
pending.clear ();
|
|
||||||
completed.clear ();
|
|
||||||
undo.clear ();
|
|
||||||
backlog.clear ();
|
|
||||||
|
|
||||||
_location = "";
|
|
||||||
_id = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void TDB2::dump ()
|
void TDB2::dump ()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -141,7 +141,6 @@ public:
|
|||||||
int num_reverts_possible ();
|
int num_reverts_possible ();
|
||||||
size_t data_size ();
|
size_t data_size ();
|
||||||
|
|
||||||
void clear ();
|
|
||||||
void dump ();
|
void dump ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -33,6 +33,16 @@
|
|||||||
|
|
||||||
Context context;
|
Context context;
|
||||||
|
|
||||||
|
void cleardb ()
|
||||||
|
{
|
||||||
|
// Remove any residual test files.
|
||||||
|
rmdir ("./extensions");
|
||||||
|
unlink ("./pending.data");
|
||||||
|
unlink ("./completed.data");
|
||||||
|
unlink ("./undo.data");
|
||||||
|
unlink ("./backlog.data");
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int main (int, char**)
|
int main (int, char**)
|
||||||
{
|
{
|
||||||
@@ -44,12 +54,7 @@ int main (int, char**)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Remove any residual test files.
|
cleardb ();
|
||||||
rmdir ("./extensions");
|
|
||||||
unlink ("./pending.data");
|
|
||||||
unlink ("./completed.data");
|
|
||||||
unlink ("./undo.data");
|
|
||||||
unlink ("./backlog.data");
|
|
||||||
|
|
||||||
// Set the context to allow GC.
|
// Set the context to allow GC.
|
||||||
context.config.set ("gc", 1);
|
context.config.set ("gc", 1);
|
||||||
@@ -98,7 +103,7 @@ int main (int, char**)
|
|||||||
context.tdb2.commit ();
|
context.tdb2.commit ();
|
||||||
|
|
||||||
// Reset for reuse.
|
// Reset for reuse.
|
||||||
context.tdb2.clear ();
|
cleardb ();
|
||||||
context.tdb2.set_location (".");
|
context.tdb2.set_location (".");
|
||||||
|
|
||||||
// TODO commit
|
// TODO commit
|
||||||
|
|||||||
Reference in New Issue
Block a user