Skip to content

Commit

Permalink
Merge pull request #423 from evoskuil/master
Browse files Browse the repository at this point in the history
Refer to snapshot as snapshot in code/message.
  • Loading branch information
evoskuil authored Mar 16, 2024
2 parents df4d0e2 + 9da865b commit fad733c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/bitcoin/database/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ enum error_t : uint8_t
clear_directory,
remove_directory,
rename_directory,
missing_backup,
missing_snapshot,
create_file,
unloaded_file,
dump_file,
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/database/impl/store.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ code CLASS::restore(const event_handler& handler) NOEXCEPT
}
else
{
ec = error::missing_backup;
ec = error::missing_snapshot;
}

const auto restore = [&handler](auto& storage, table_t table) NOEXCEPT
Expand Down
2 changes: 1 addition & 1 deletion src/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ DEFINE_ERROR_T_MESSAGE_MAP(error)
{ clear_directory, "clear directory failure" },
{ remove_directory, "remove directory failure" },
{ rename_directory, "rename directory failure" },
{ missing_backup, "missing backup" },
{ missing_snapshot, "missing snapshot" },
{ create_file, "file failed to create" },
{ unloaded_file, "file not loaded" },
{ dump_file, "file failed to dump" },
Expand Down
6 changes: 3 additions & 3 deletions test/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ BOOST_AUTO_TEST_CASE(error_t__code__rename_directory__true_exected_message)
BOOST_REQUIRE_EQUAL(ec.message(), "rename directory failure");
}

BOOST_AUTO_TEST_CASE(error_t__code__missing_backup__true_exected_message)
BOOST_AUTO_TEST_CASE(error_t__code__missing_snapshot__true_exected_message)
{
constexpr auto value = error::missing_backup;
constexpr auto value = error::missing_snapshot;
const auto ec = code(value);
BOOST_REQUIRE(ec);
BOOST_REQUIRE(ec == value);
BOOST_REQUIRE_EQUAL(ec.message(), "missing backup");
BOOST_REQUIRE_EQUAL(ec.message(), "missing snapshot");
}

BOOST_AUTO_TEST_CASE(error_t__code__create_file__true_exected_message)
Expand Down
8 changes: 4 additions & 4 deletions test/store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,13 +450,13 @@ BOOST_AUTO_TEST_CASE(store__restore__flush_locked__flush_lock)
BOOST_REQUIRE_EQUAL(instance.restore(events), error::flush_lock);
}

BOOST_AUTO_TEST_CASE(store__restore__process_lock_file__missing_backup)
BOOST_AUTO_TEST_CASE(store__restore__process_lock_file__missing_snapshot)
{
settings configuration{};
configuration.path = TEST_DIRECTORY;
test::map_store instance{ configuration };
BOOST_REQUIRE(test::create(instance.process_lock_file()));
BOOST_REQUIRE_EQUAL(instance.restore(events), error::missing_backup);
BOOST_REQUIRE_EQUAL(instance.restore(events), error::missing_snapshot);
}

BOOST_AUTO_TEST_CASE(store__restore__failure__unlocks)
Expand All @@ -470,12 +470,12 @@ BOOST_AUTO_TEST_CASE(store__restore__failure__unlocks)
BOOST_REQUIRE(instance.transactor_mutex().try_lock());
}

BOOST_AUTO_TEST_CASE(store__restore__no_backups__missing_backup)
BOOST_AUTO_TEST_CASE(store__restore__no_backups__missing_snapshot)
{
settings configuration{};
configuration.path = TEST_DIRECTORY;
test::map_store instance{ configuration };
BOOST_REQUIRE_EQUAL(instance.restore_(), error::missing_backup);
BOOST_REQUIRE_EQUAL(instance.restore_(), error::missing_snapshot);
}

// The lock is process-exclusive in linux/macOS, globally in win32.
Expand Down

0 comments on commit fad733c

Please sign in to comment.