From 0d2fec1919f12dbc166278484e0272cb2b229f1f Mon Sep 17 00:00:00 2001 From: Gammasoft Date: Thu, 10 Oct 2024 19:43:16 +0200 Subject: [PATCH] Add messages --- src/xtd.core/include/xtd/h_result.h | 24 +++++++++---------- src/xtd.core/src/xtd/h_result.cpp | 24 +++++++++---------- .../src/xtd/tests/h_result_tests.cpp | 24 +++++++++---------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/xtd.core/include/xtd/h_result.h b/src/xtd.core/include/xtd/h_result.h index 7eb9ee41ecb..e79535e55c1 100644 --- a/src/xtd.core/include/xtd/h_result.h +++ b/src/xtd.core/include/xtd/h_result.h @@ -270,7 +270,7 @@ namespace xtd { static constexpr int32 DISP_E_PARAMNOTFOUND = static_cast(0x80020004); /// @brief Attempt to access a variable with an incompatible type. static constexpr int32 DISP_E_TYPEMISMATCH = static_cast(0x80020005); - /// @brief Invalid virable type. + /// @brief Invalid variable type. static constexpr int32 DISP_E_BADVARTYPE = static_cast(0x80020008); /// @brief Arithmetic operation resulted in an overflow. static constexpr int32 DISP_E_OVERFLOW = static_cast(0x8002000A); @@ -312,27 +312,27 @@ namespace xtd { static constexpr int32 CTL_E_PATHNOTFOUND = static_cast(0x800A004C); /// @brief Unable to find the specified file. static constexpr int32 CTL_E_FILENOTFOUND = static_cast(0x800A0035); - /// @brief + /// @brief Fusion invalid name exception. static constexpr int32 FUSION_E_INVALID_NAME = static_cast(0x80131047); - /// @brief + /// @brief Fusion the reference definition is incompatible. static constexpr int32 FUSION_E_REF_DEF_MISMATCH = static_cast(0x80131040); - /// @brief + /// @brief Too many open files. static constexpr int32 ERROR_TOO_MANY_OPEN_FILES = static_cast(0x80070004); - /// @brief + /// @brief Sharing violation. static constexpr int32 ERROR_SHARING_VIOLATION = static_cast(0x80070020); - /// @brief + /// @brief Lock violations. static constexpr int32 ERROR_LOCK_VIOLATION = static_cast(0x80070021); - /// @brief + /// @brief Open failed. static constexpr int32 ERROR_OPEN_FAILED = static_cast(0x8007006E); - /// @brief + /// @brief Disk corrupt. static constexpr int32 ERROR_DISK_CORRUPT = static_cast(0x80070571); - /// @brief + /// @brief Unrecognized volume. static constexpr int32 ERROR_UNRECOGNIZED_VOLUME = static_cast(0x800703ED); - /// @brief + /// @brief DLL init failed. static constexpr int32 ERROR_DLL_INIT_FAILED = static_cast(0x8007045A); - /// @brief + /// @brief Assembly load in progress. static constexpr int32 MSEE_E_ASSEMBLYLOADINPROGRESS = static_cast(0x80131016); - /// @brief + /// @brief File invalid. static constexpr int32 ERROR_FILE_INVALID = static_cast(0x800703EE); /// @} diff --git a/src/xtd.core/src/xtd/h_result.cpp b/src/xtd.core/src/xtd/h_result.cpp index 9cddb0890b3..452348502d7 100644 --- a/src/xtd.core/src/xtd/h_result.cpp +++ b/src/xtd.core/src/xtd/h_result.cpp @@ -254,7 +254,7 @@ const std::unordered_map& h_result::get_messages() noexcept { {CO_E_NOTINITIALIZED, "Not initialized"_t}, {DISP_E_PARAMNOTFOUND, "Could not find the parameter."_t}, {DISP_E_TYPEMISMATCH, "Attempt to access a variable with an incompatible type."_t}, - {DISP_E_BADVARTYPE, "Invalid virable type."_t}, + {DISP_E_BADVARTYPE, "Invalid variable type."_t}, {DISP_E_OVERFLOW, "Arithmetic operation resulted in an overflow."_t}, {DISP_E_DIVBYZERO, "Attempted to divide by zero."_t}, {E_ABORT, "Operation aborted."_t}, @@ -275,17 +275,17 @@ const std::unordered_map& h_result::get_messages() noexcept { {STG_E_PATHNOTFOUND, "Attempted to access a path that is not on the disk."_t}, {CTL_E_PATHNOTFOUND, "Attempted to access a path that is not on the disk."_t}, {CTL_E_FILENOTFOUND, "Unable to find the specified file."_t}, - {FUSION_E_INVALID_NAME, ""_t}, - {FUSION_E_REF_DEF_MISMATCH, ""_t}, - {ERROR_TOO_MANY_OPEN_FILES, ""_t}, - {ERROR_SHARING_VIOLATION, ""_t}, - {ERROR_LOCK_VIOLATION, ""_t}, - {ERROR_OPEN_FAILED, ""_t}, - {ERROR_DISK_CORRUPT, ""_t}, - {ERROR_UNRECOGNIZED_VOLUME, ""_t}, - {ERROR_DLL_INIT_FAILED, ""_t}, - {MSEE_E_ASSEMBLYLOADINPROGRESS, ""_t}, - {ERROR_FILE_INVALID, ""_t}, + {FUSION_E_INVALID_NAME, "Fusion invalid name exception."_t}, + {FUSION_E_REF_DEF_MISMATCH, "Fusion the reference definition is incompatible."_t}, + {ERROR_TOO_MANY_OPEN_FILES, "Too many open files."_t}, + {ERROR_SHARING_VIOLATION, "Sharing violation."_t}, + {ERROR_LOCK_VIOLATION, "Lock violations."_t}, + {ERROR_OPEN_FAILED, "Open failed."_t}, + {ERROR_DISK_CORRUPT, "Disk corrupt."_t}, + {ERROR_UNRECOGNIZED_VOLUME, "Unrecognized volume."_t}, + {ERROR_DLL_INIT_FAILED, "DLL init failed."_t}, + {MSEE_E_ASSEMBLYLOADINPROGRESS, "Assembly load in progress."_t}, + {ERROR_FILE_INVALID, "File invalid."_t}, }; return h_result_messages; } diff --git a/tests/xtd.core.unit_tests/src/xtd/tests/h_result_tests.cpp b/tests/xtd.core.unit_tests/src/xtd/tests/h_result_tests.cpp index 93a1d26b40e..02d6d178c0a 100644 --- a/tests/xtd.core.unit_tests/src/xtd/tests/h_result_tests.cpp +++ b/tests/xtd.core.unit_tests/src/xtd/tests/h_result_tests.cpp @@ -842,7 +842,7 @@ namespace xtd::tests { } void test_method_(get_message_with_DISP_E_BADVARTYPE) { - assert::are_equal("Invalid virable type.", h_result::get_message(h_result::DISP_E_BADVARTYPE), csf_); + assert::are_equal("Invalid variable type.", h_result::get_message(h_result::DISP_E_BADVARTYPE), csf_); } void test_method_(get_message_with_DISP_E_OVERFLOW) { @@ -926,47 +926,47 @@ namespace xtd::tests { } void test_method_(get_message_with_FUSION_E_INVALID_NAME) { - assert::are_equal("", h_result::get_message(h_result::FUSION_E_INVALID_NAME), csf_); + assert::are_equal("Fusion invalid name exception.", h_result::get_message(h_result::FUSION_E_INVALID_NAME), csf_); } void test_method_(get_message_with_FUSION_E_REF_DEF_MISMATCH) { - assert::are_equal("", h_result::get_message(h_result::FUSION_E_REF_DEF_MISMATCH), csf_); + assert::are_equal("Fusion the reference definition is incompatible.", h_result::get_message(h_result::FUSION_E_REF_DEF_MISMATCH), csf_); } void test_method_(get_message_with_ERROR_TOO_MANY_OPEN_FILES) { - assert::are_equal("", h_result::get_message(h_result::ERROR_TOO_MANY_OPEN_FILES), csf_); + assert::are_equal("Too many open files.", h_result::get_message(h_result::ERROR_TOO_MANY_OPEN_FILES), csf_); } void test_method_(get_message_with_ERROR_SHARING_VIOLATION) { - assert::are_equal("", h_result::get_message(h_result::ERROR_SHARING_VIOLATION), csf_); + assert::are_equal("Sharing violation.", h_result::get_message(h_result::ERROR_SHARING_VIOLATION), csf_); } void test_method_(get_message_with_ERROR_LOCK_VIOLATION) { - assert::are_equal("", h_result::get_message(h_result::ERROR_LOCK_VIOLATION), csf_); + assert::are_equal("Lock violations.", h_result::get_message(h_result::ERROR_LOCK_VIOLATION), csf_); } void test_method_(get_message_with_ERROR_OPEN_FAILED) { - assert::are_equal("", h_result::get_message(h_result::ERROR_OPEN_FAILED), csf_); + assert::are_equal("Open failed.", h_result::get_message(h_result::ERROR_OPEN_FAILED), csf_); } void test_method_(get_message_with_ERROR_DISK_CORRUPT) { - assert::are_equal("", h_result::get_message(h_result::ERROR_DISK_CORRUPT), csf_); + assert::are_equal("Disk corrupt.", h_result::get_message(h_result::ERROR_DISK_CORRUPT), csf_); } void test_method_(get_message_with_ERROR_UNRECOGNIZED_VOLUME) { - assert::are_equal("", h_result::get_message(h_result::ERROR_UNRECOGNIZED_VOLUME), csf_); + assert::are_equal("Unrecognized volume.", h_result::get_message(h_result::ERROR_UNRECOGNIZED_VOLUME), csf_); } void test_method_(get_message_with_ERROR_DLL_INIT_FAILED) { - assert::are_equal("", h_result::get_message(h_result::ERROR_DLL_INIT_FAILED), csf_); + assert::are_equal("DLL init failed.", h_result::get_message(h_result::ERROR_DLL_INIT_FAILED), csf_); } void test_method_(get_message_with_MSEE_E_ASSEMBLYLOADINPROGRESS) { - assert::are_equal("", h_result::get_message(h_result::MSEE_E_ASSEMBLYLOADINPROGRESS), csf_); + assert::are_equal("Assembly load in progress.", h_result::get_message(h_result::MSEE_E_ASSEMBLYLOADINPROGRESS), csf_); } void test_method_(get_message_with_ERROR_FILE_INVALID) { - assert::are_equal("", h_result::get_message(h_result::ERROR_FILE_INVALID), csf_); + assert::are_equal("File invalid.", h_result::get_message(h_result::ERROR_FILE_INVALID), csf_); } void test_method_(make_error_code_with_S_OK) {