Skip to content

Commit

Permalink
Add messages
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Oct 10, 2024
1 parent b276e55 commit 0d2fec1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
24 changes: 12 additions & 12 deletions src/xtd.core/include/xtd/h_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ namespace xtd {
static constexpr int32 DISP_E_PARAMNOTFOUND = static_cast<int32>(0x80020004);
/// @brief Attempt to access a variable with an incompatible type.
static constexpr int32 DISP_E_TYPEMISMATCH = static_cast<int32>(0x80020005);
/// @brief Invalid virable type.
/// @brief Invalid variable type.
static constexpr int32 DISP_E_BADVARTYPE = static_cast<int32>(0x80020008);
/// @brief Arithmetic operation resulted in an overflow.
static constexpr int32 DISP_E_OVERFLOW = static_cast<int32>(0x8002000A);
Expand Down Expand Up @@ -312,27 +312,27 @@ namespace xtd {
static constexpr int32 CTL_E_PATHNOTFOUND = static_cast<int32>(0x800A004C);
/// @brief Unable to find the specified file.
static constexpr int32 CTL_E_FILENOTFOUND = static_cast<int32>(0x800A0035);
/// @brief
/// @brief Fusion invalid name exception.
static constexpr int32 FUSION_E_INVALID_NAME = static_cast<int32>(0x80131047);
/// @brief
/// @brief Fusion the reference definition is incompatible.
static constexpr int32 FUSION_E_REF_DEF_MISMATCH = static_cast<int32>(0x80131040);
/// @brief
/// @brief Too many open files.
static constexpr int32 ERROR_TOO_MANY_OPEN_FILES = static_cast<int32>(0x80070004);
/// @brief
/// @brief Sharing violation.
static constexpr int32 ERROR_SHARING_VIOLATION = static_cast<int32>(0x80070020);
/// @brief
/// @brief Lock violations.
static constexpr int32 ERROR_LOCK_VIOLATION = static_cast<int32>(0x80070021);
/// @brief
/// @brief Open failed.
static constexpr int32 ERROR_OPEN_FAILED = static_cast<int32>(0x8007006E);
/// @brief
/// @brief Disk corrupt.
static constexpr int32 ERROR_DISK_CORRUPT = static_cast<int32>(0x80070571);
/// @brief
/// @brief Unrecognized volume.
static constexpr int32 ERROR_UNRECOGNIZED_VOLUME = static_cast<int32>(0x800703ED);
/// @brief
/// @brief DLL init failed.
static constexpr int32 ERROR_DLL_INIT_FAILED = static_cast<int32>(0x8007045A);
/// @brief
/// @brief Assembly load in progress.
static constexpr int32 MSEE_E_ASSEMBLYLOADINPROGRESS = static_cast<int32>(0x80131016);
/// @brief
/// @brief File invalid.
static constexpr int32 ERROR_FILE_INVALID = static_cast<int32>(0x800703EE);
/// @}

Expand Down
24 changes: 12 additions & 12 deletions src/xtd.core/src/xtd/h_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ const std::unordered_map<int32, string>& 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},
Expand All @@ -275,17 +275,17 @@ const std::unordered_map<int32, string>& 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;
}
Expand Down
24 changes: 12 additions & 12 deletions tests/xtd.core.unit_tests/src/xtd/tests/h_result_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 0d2fec1

Please sign in to comment.