Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
lmdb_store.test.cpp File Reference
#include <cstddef>
#include <cstdint>
#include <gtest/gtest.h>
#include <chrono>
#include <cstdlib>
#include <filesystem>
#include <memory>
#include <optional>
#include <sstream>
#include <stdexcept>
#include <vector>
#include "barretenberg/common/serialize.hpp"
#include "barretenberg/common/streams.hpp"
#include "barretenberg/common/test.hpp"
#include "barretenberg/lmdblib/fixtures.hpp"
#include "barretenberg/lmdblib/lmdb_cursor.hpp"
#include "barretenberg/lmdblib/lmdb_database.hpp"
#include "barretenberg/lmdblib/lmdb_db_transaction.hpp"
#include "barretenberg/lmdblib/lmdb_environment.hpp"
#include "barretenberg/lmdblib/lmdb_read_transaction.hpp"
#include "barretenberg/lmdblib/lmdb_store.hpp"
#include "barretenberg/lmdblib/lmdb_write_transaction.hpp"
#include "barretenberg/lmdblib/queries.hpp"
#include "barretenberg/lmdblib/types.hpp"

Go to the source code of this file.

Classes

class  LMDBStoreTest
 

Functions

LMDBStore::Ptr create_store (uint32_t maxNumDbs=1)
 
void prepare_test_data (int64_t numKeys, int64_t numValues, KeyDupValuesVector &testData, int64_t keyOffset=0)
 
void write_test_data (std::vector< std::string > dbNames, int64_t numKeys, int64_t numValues, LMDBStore &store, int64_t keyOffset=0)
 
 TEST_F (LMDBStoreTest, can_create_store)
 
 TEST_F (LMDBStoreTest, can_create_database)
 
 TEST_F (LMDBStoreTest, can_not_create_more_databases_then_specified)
 
 TEST_F (LMDBStoreTest, can_write_to_database)
 
 TEST_F (LMDBStoreTest, can_not_write_to_database_that_does_not_exist)
 
 TEST_F (LMDBStoreTest, can_close_database)
 
 TEST_F (LMDBStoreTest, can_write_duplicate_keys_to_database)
 
 TEST_F (LMDBStoreTest, can_write_the_same_data_multiple_times)
 
 TEST_F (LMDBStoreTest, can_read_from_database)
 
 TEST_F (LMDBStoreTest, can_not_read_from_non_existent_database)
 
 TEST_F (LMDBStoreTest, can_write_and_read_multiple)
 
 TEST_F (LMDBStoreTest, can_write_and_read_multiple_duplicates)
 
 TEST_F (LMDBStoreTest, can_read_missing_keys_from_database)
 
 TEST_F (LMDBStoreTest, can_write_and_delete)
 
 TEST_F (LMDBStoreTest, can_write_and_delete_duplicates)
 
 TEST_F (LMDBStoreTest, can_delete_all_values_from_keys)
 
 TEST_F (LMDBStoreTest, can_read_forwards_with_cursors)
 
 TEST_F (LMDBStoreTest, can_read_duplicate_values_forwards_with_cursors)
 
 TEST_F (LMDBStoreTest, can_read_backwards_with_cursors)
 
 TEST_F (LMDBStoreTest, can_read_duplicate_values_backwards_with_cursors)
 
 TEST_F (LMDBStoreTest, can_read_past_the_end_with_cursors)
 
 TEST_F (LMDBStoreTest, can_read_past_the_start_with_cursors)
 
 TEST_F (LMDBStoreTest, can_read_duplicates_past_the_end_with_cursors)
 
 TEST_F (LMDBStoreTest, can_read_duplicates_past_the_start_with_cursors)
 
 TEST_F (LMDBStoreTest, can_read_in_both_directions_with_cursors)
 
 TEST_F (LMDBStoreTest, can_count_in_both_directions_with_cursors)
 
 TEST_F (LMDBStoreTest, can_count_in_both_directions_with_cursors_with_holes)
 
 TEST_F (LMDBStoreTest, can_count_past_end_in_both_directions_with_cursors)
 
 TEST_F (LMDBStoreTest, can_count_duplicates_in_both_directions_with_cursors)
 
 TEST_F (LMDBStoreTest, can_count_duplicates_past_end_in_both_directions_with_cursors)
 
 TEST_F (LMDBStoreTest, can_use_multiple_cursors_with_same_tx)
 
 TEST_F (LMDBStoreTest, can_write_and_delete_many_times)
 
 TEST_F (LMDBStoreTest, reports_stats)
 
 TEST_F (LMDBStoreTest, can_read_data_from_multiple_threads)
 

Function Documentation

◆ create_store()

LMDBStore::Ptr create_store ( uint32_t  maxNumDbs = 1)

Definition at line 52 of file lmdb_store.test.cpp.

◆ prepare_test_data()

void prepare_test_data ( int64_t  numKeys,
int64_t  numValues,
KeyDupValuesVector testData,
int64_t  keyOffset = 0 
)

Definition at line 58 of file lmdb_store.test.cpp.

◆ TEST_F() [1/34]

TEST_F ( LMDBStoreTest  ,
can_close_database   
)

Definition at line 139 of file lmdb_store.test.cpp.

◆ TEST_F() [2/34]

TEST_F ( LMDBStoreTest  ,
can_count_duplicates_in_both_directions_with_cursors   
)

Definition at line 1091 of file lmdb_store.test.cpp.

◆ TEST_F() [3/34]

TEST_F ( LMDBStoreTest  ,
can_count_duplicates_past_end_in_both_directions_with_cursors   
)

Definition at line 1156 of file lmdb_store.test.cpp.

◆ TEST_F() [4/34]

TEST_F ( LMDBStoreTest  ,
can_count_in_both_directions_with_cursors   
)

Definition at line 918 of file lmdb_store.test.cpp.

◆ TEST_F() [5/34]

TEST_F ( LMDBStoreTest  ,
can_count_in_both_directions_with_cursors_with_holes   
)

Definition at line 983 of file lmdb_store.test.cpp.

◆ TEST_F() [6/34]

TEST_F ( LMDBStoreTest  ,
can_count_past_end_in_both_directions_with_cursors   
)

Definition at line 1026 of file lmdb_store.test.cpp.

◆ TEST_F() [7/34]

TEST_F ( LMDBStoreTest  ,
can_create_database   
)

Definition at line 91 of file lmdb_store.test.cpp.

◆ TEST_F() [8/34]

TEST_F ( LMDBStoreTest  ,
can_create_store   
)

Definition at line 86 of file lmdb_store.test.cpp.

◆ TEST_F() [9/34]

TEST_F ( LMDBStoreTest  ,
can_delete_all_values_from_keys   
)

Definition at line 499 of file lmdb_store.test.cpp.

◆ TEST_F() [10/34]

TEST_F ( LMDBStoreTest  ,
can_not_create_more_databases_then_specified   
)

Definition at line 98 of file lmdb_store.test.cpp.

◆ TEST_F() [11/34]

TEST_F ( LMDBStoreTest  ,
can_not_read_from_non_existent_database   
)

Definition at line 234 of file lmdb_store.test.cpp.

◆ TEST_F() [12/34]

TEST_F ( LMDBStoreTest  ,
can_not_write_to_database_that_does_not_exist   
)

Definition at line 124 of file lmdb_store.test.cpp.

◆ TEST_F() [13/34]

TEST_F ( LMDBStoreTest  ,
can_read_backwards_with_cursors   
)

Definition at line 652 of file lmdb_store.test.cpp.

◆ TEST_F() [14/34]

TEST_F ( LMDBStoreTest  ,
can_read_data_from_multiple_threads   
)

Definition at line 1327 of file lmdb_store.test.cpp.

◆ TEST_F() [15/34]

TEST_F ( LMDBStoreTest  ,
can_read_duplicate_values_backwards_with_cursors   
)

Definition at line 687 of file lmdb_store.test.cpp.

◆ TEST_F() [16/34]

TEST_F ( LMDBStoreTest  ,
can_read_duplicate_values_forwards_with_cursors   
)

Definition at line 612 of file lmdb_store.test.cpp.

◆ TEST_F() [17/34]

TEST_F ( LMDBStoreTest  ,
can_read_duplicates_past_the_end_with_cursors   
)

Definition at line 797 of file lmdb_store.test.cpp.

◆ TEST_F() [18/34]

TEST_F ( LMDBStoreTest  ,
can_read_duplicates_past_the_start_with_cursors   
)

Definition at line 837 of file lmdb_store.test.cpp.

◆ TEST_F() [19/34]

TEST_F ( LMDBStoreTest  ,
can_read_forwards_with_cursors   
)

Definition at line 577 of file lmdb_store.test.cpp.

◆ TEST_F() [20/34]

TEST_F ( LMDBStoreTest  ,
can_read_from_database   
)

Definition at line 212 of file lmdb_store.test.cpp.

◆ TEST_F() [21/34]

TEST_F ( LMDBStoreTest  ,
can_read_in_both_directions_with_cursors   
)

Definition at line 877 of file lmdb_store.test.cpp.

◆ TEST_F() [22/34]

TEST_F ( LMDBStoreTest  ,
can_read_missing_keys_from_database   
)

Definition at line 342 of file lmdb_store.test.cpp.

◆ TEST_F() [23/34]

TEST_F ( LMDBStoreTest  ,
can_read_past_the_end_with_cursors   
)

Definition at line 727 of file lmdb_store.test.cpp.

◆ TEST_F() [24/34]

TEST_F ( LMDBStoreTest  ,
can_read_past_the_start_with_cursors   
)

Definition at line 762 of file lmdb_store.test.cpp.

◆ TEST_F() [25/34]

TEST_F ( LMDBStoreTest  ,
can_use_multiple_cursors_with_same_tx   
)

Definition at line 1220 of file lmdb_store.test.cpp.

◆ TEST_F() [26/34]

TEST_F ( LMDBStoreTest  ,
can_write_and_delete   
)

Definition at line 368 of file lmdb_store.test.cpp.

◆ TEST_F() [27/34]

TEST_F ( LMDBStoreTest  ,
can_write_and_delete_duplicates   
)

Definition at line 424 of file lmdb_store.test.cpp.

◆ TEST_F() [28/34]

TEST_F ( LMDBStoreTest  ,
can_write_and_delete_many_times   
)

Definition at line 1261 of file lmdb_store.test.cpp.

◆ TEST_F() [29/34]

TEST_F ( LMDBStoreTest  ,
can_write_and_read_multiple   
)

Definition at line 253 of file lmdb_store.test.cpp.

◆ TEST_F() [30/34]

TEST_F ( LMDBStoreTest  ,
can_write_and_read_multiple_duplicates   
)

Definition at line 293 of file lmdb_store.test.cpp.

◆ TEST_F() [31/34]

TEST_F ( LMDBStoreTest  ,
can_write_duplicate_keys_to_database   
)

Definition at line 164 of file lmdb_store.test.cpp.

◆ TEST_F() [32/34]

TEST_F ( LMDBStoreTest  ,
can_write_the_same_data_multiple_times   
)

Definition at line 186 of file lmdb_store.test.cpp.

◆ TEST_F() [33/34]

TEST_F ( LMDBStoreTest  ,
can_write_to_database   
)

Definition at line 109 of file lmdb_store.test.cpp.

◆ TEST_F() [34/34]

TEST_F ( LMDBStoreTest  ,
reports_stats   
)

Definition at line 1293 of file lmdb_store.test.cpp.

◆ write_test_data()

void write_test_data ( std::vector< std::string >  dbNames,
int64_t  numKeys,
int64_t  numValues,
LMDBStore store,
int64_t  keyOffset = 0 
)

Definition at line 73 of file lmdb_store.test.cpp.