大更新
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "config_store.hpp"
|
||||
#include <cassert>
|
||||
#include "adminive_test.hpp"
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
int main() {
|
||||
@@ -9,18 +9,18 @@ int main() {
|
||||
std::filesystem::remove_all(test_directory);
|
||||
{
|
||||
Config_Store store(config_path);
|
||||
assert(std::filesystem::exists(config_path));
|
||||
assert(store.radio_service().snapshot().profile_name == "Primary Radio Profile");
|
||||
ADMINIVE_CHECK(std::filesystem::exists(config_path));
|
||||
ADMINIVE_CHECK(store.radio_service().snapshot().profile_name == "Primary Radio Profile");
|
||||
auto updated = store.radio_service().snapshot();
|
||||
updated.profile_name = "Persisted Profile";
|
||||
store.persist_radio_service(updated);
|
||||
assert(store.radio_service().snapshot().profile_name == "Persisted Profile");
|
||||
assert(!std::filesystem::exists(config_path.string() + ".tmp"));
|
||||
ADMINIVE_CHECK(store.radio_service().snapshot().profile_name == "Persisted Profile");
|
||||
ADMINIVE_CHECK(!std::filesystem::exists(config_path.string() + ".tmp"));
|
||||
}
|
||||
{
|
||||
Config_Store store(config_path);
|
||||
assert(store.radio_service().snapshot().profile_name == "Persisted Profile");
|
||||
assert(store.default_device_type() == Device_Table_Type::serial);
|
||||
ADMINIVE_CHECK(store.radio_service().snapshot().profile_name == "Persisted Profile");
|
||||
ADMINIVE_CHECK(store.default_device_type() == Device_Table_Type::serial);
|
||||
}
|
||||
std::filesystem::remove_all(test_directory);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user