refactored
This commit is contained in:
@ -1,21 +1,21 @@
|
||||
if(OJ_TEST_BPT)
|
||||
add_executable(code oj_test_interface_for_bpt.cpp)
|
||||
target_link_libraries(code bpt)
|
||||
target_link_libraries(code storage)
|
||||
set_target_properties(code PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
endif()
|
||||
add_executable(replacer_test replacer_test.cpp)
|
||||
target_link_libraries(replacer_test bpt GTest::gtest_main)
|
||||
target_link_libraries(replacer_test storage GTest::gtest_main)
|
||||
add_executable(buffer_pool_manager_test buffer_pool_manager_test.cpp)
|
||||
target_link_libraries(buffer_pool_manager_test bpt GTest::gtest_main spdlog::spdlog)
|
||||
target_link_libraries(buffer_pool_manager_test storage GTest::gtest_main spdlog::spdlog)
|
||||
add_executable(page_guard_test page_guard_test.cpp)
|
||||
target_link_libraries(page_guard_test bpt GTest::gtest_main)
|
||||
target_link_libraries(page_guard_test storage GTest::gtest_main)
|
||||
add_executable(bpt_basic_test bpt_basic_test.cpp)
|
||||
target_link_libraries(bpt_basic_test bpt GTest::gtest_main spdlog::spdlog)
|
||||
target_link_libraries(bpt_basic_test storage GTest::gtest_main spdlog::spdlog)
|
||||
add_executable(buffer_pool_manager_extreme_test buffer_pool_manager_extreme_test.cpp)
|
||||
target_link_libraries(buffer_pool_manager_extreme_test bpt)
|
||||
target_link_libraries(buffer_pool_manager_extreme_test storage)
|
||||
add_executable(t1_std t1_std.cpp)
|
||||
set_target_properties(t1_std PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
add_executable(t1_mk t1_mk.cpp)
|
||||
set_target_properties(t1_mk PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
add_executable(bpt_advanced_test bpt_advanced_test.cpp)
|
||||
target_link_libraries(bpt_advanced_test bpt GTest::gtest_main spdlog::spdlog)
|
||||
target_link_libraries(bpt_advanced_test storage GTest::gtest_main spdlog::spdlog)
|
@ -1,8 +1,8 @@
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include "bpt/buffer_pool_manager.h"
|
||||
#include "bpt/config.h"
|
||||
#include "bpt/disk_manager.h"
|
||||
#include "storage/buffer_pool_manager.h"
|
||||
#include "storage/config.h"
|
||||
#include "storage/disk_manager.h"
|
||||
#ifndef BPT_MEMORYRIVER_HPP
|
||||
#define BPT_MEMORYRIVER_HPP
|
||||
|
||||
|
@ -5,10 +5,10 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <map>
|
||||
#include <random>
|
||||
#include "bpt/bpt.hpp"
|
||||
#include "bpt/buffer_pool_manager.h"
|
||||
#include "bpt/config.h"
|
||||
#include "bpt/disk_manager.h"
|
||||
#include "storage/bpt.hpp"
|
||||
#include "storage/buffer_pool_manager.h"
|
||||
#include "storage/config.h"
|
||||
#include "storage/disk_manager.h"
|
||||
namespace bpt_advanced_test {
|
||||
template <size_t length>
|
||||
class FixLengthString {
|
||||
|
@ -5,10 +5,10 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <map>
|
||||
#include <random>
|
||||
#include "bpt/bpt.hpp"
|
||||
#include "bpt/buffer_pool_manager.h"
|
||||
#include "bpt/config.h"
|
||||
#include "bpt/disk_manager.h"
|
||||
#include "storage/bpt.hpp"
|
||||
#include "storage/buffer_pool_manager.h"
|
||||
#include "storage/config.h"
|
||||
#include "storage/disk_manager.h"
|
||||
namespace bpt_basic_test {
|
||||
template <size_t length>
|
||||
class FixLengthString {
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "bpt/buffer_pool_manager.h"
|
||||
#include "storage/buffer_pool_manager.h"
|
||||
#include <gtest/gtest.h>
|
||||
#include <spdlog/async.h>
|
||||
#include <spdlog/sinks/basic_file_sink.h>
|
||||
@ -14,9 +14,9 @@
|
||||
#include <vector>
|
||||
#include "MemoryRiver.hpp"
|
||||
#include "MemoryRiverStd.hpp"
|
||||
#include "bpt/bpt_page.hpp"
|
||||
#include "bpt/config.h"
|
||||
#include "bpt/disk_manager.h"
|
||||
#include "storage/bpt_page.hpp"
|
||||
#include "storage/config.h"
|
||||
#include "storage/disk_manager.h"
|
||||
// Demonstrate some basic assertions.
|
||||
TEST(HelloTest, BasicAssertions) {
|
||||
// Expect two strings not to be equal.
|
||||
|
@ -3,8 +3,8 @@
|
||||
#include <ios>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "bpt/bpt.hpp"
|
||||
#include "bpt/buffer_pool_manager.h"
|
||||
#include "storage/bpt.hpp"
|
||||
#include "storage/buffer_pool_manager.h"
|
||||
typedef uint64_t hash_t;
|
||||
inline hash_t Hash(std::string str) noexcept {
|
||||
constexpr static char salt1[10] = "mL;]-=eT";
|
||||
|
@ -4,8 +4,8 @@
|
||||
#include <memory>
|
||||
#include <random>
|
||||
#include <string>
|
||||
#include "bpt/buffer_pool_manager.h"
|
||||
#include "bpt/config.h"
|
||||
#include "storage/buffer_pool_manager.h"
|
||||
#include "storage/config.h"
|
||||
|
||||
TEST(PageGuardTest, SampleTest) {
|
||||
const std::string db_name = "/tmp/test.db";
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "bpt/replacer.h"
|
||||
#include "storage/replacer.h"
|
||||
#include <gtest/gtest.h>
|
||||
#include "bpt/config.h"
|
||||
#include "storage/config.h"
|
||||
// Demonstrate some basic assertions.
|
||||
TEST(HelloTest, BasicAssertions) {
|
||||
// Expect two strings not to be equal.
|
||||
|
Reference in New Issue
Block a user