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 8db2edf commit b342ccb
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 44 deletions.
28 changes: 14 additions & 14 deletions src/xtd.core/include/xtd/h_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,25 +268,25 @@ namespace xtd {
static constexpr int32 CO_E_NOTINITIALIZED = static_cast<int32>(0x800401F0);
/// @brief Could not find the parameter.
static constexpr int32 DISP_E_PARAMNOTFOUND = static_cast<int32>(0x80020004);
/// @brief
/// @brief Attempt to access a variable with an incompatible type.
static constexpr int32 DISP_E_TYPEMISMATCH = static_cast<int32>(0x80020005);
/// @brief
/// @brief Invalid virable type.
static constexpr int32 DISP_E_BADVARTYPE = static_cast<int32>(0x80020008);
/// @brief
/// @brief Arithmetic operation resulted in an overflow.
static constexpr int32 DISP_E_OVERFLOW = static_cast<int32>(0x8002000A);
/// @brief Attempted to divide by zero.
static constexpr int32 DISP_E_DIVBYZERO = static_cast<int32>(0x80020012); // Duplicate with COR_E_DIVIDEBYZERO
/// @brief Operation aborted.
static constexpr int32 E_ABORT = static_cast<int32>(0x80004004);
/// @brief
/// @brief Bounds exception.
static constexpr int32 E_BOUNDS = static_cast<int32>(0x8000000B);
/// @brief
/// @brief The state has been modified.
static constexpr int32 E_CHANGED_STATE = static_cast<int32>(0x8000000C);
/// @brief Unable to find the specified file.
static constexpr int32 E_FILENOTFOUND = static_cast<int32>(0x80070002); // Duplicate with COR_E_FILENOTFOUND
/// @brief Unspecified failure.
static constexpr int32 E_FAIL = static_cast<int32>(0x80004005);
/// @brief
/// @brief The handle is invalid.
static constexpr int32 E_HANDLE = static_cast<int32>(0x80070006);
/// @brief Value does not fall within the expected range.
static constexpr int32 E_INVALIDARG = static_cast<int32>(0x80070057); // Duplicate with COR_E_ARGUMENT
Expand All @@ -296,21 +296,21 @@ namespace xtd {
static constexpr int32 E_POINTER = static_cast<int32>(0x80004003);
/// @brief Unexpected failure.
static constexpr int32 E_UNEXPECTED = static_cast<int32>(0x8000FFFF);
/// @brief
/// @brief Resource map not found.
static constexpr int32 ERROR_MRM_MAP_NOT_FOUND = static_cast<int32>(0x80073B1F);
/// @brief
/// @brief The operation has timed out.
static constexpr int32 ERROR_TIMEOUT = static_cast<int32>(0x800705B4);
/// @brief
/// @brief The object has been closed.
static constexpr int32 RO_E_CLOSED = static_cast<int32>(0x80000013);
/// @brief
/// @brief Cannot change the current thread mode.
static constexpr int32 RPC_E_CHANGED_MODE = static_cast<int32>(0x80010106);
/// @brief
/// @brief Incompatible type.
static constexpr int32 TYPE_E_TYPEMISMATCH = static_cast<int32>(0x80028CA0);
/// @brief
/// @brief Attempted to access a path that is not on the disk.
static constexpr int32 STG_E_PATHNOTFOUND = static_cast<int32>(0x80030003);
/// @brief
/// @brief Attempted to access a path that is not on the disk.
static constexpr int32 CTL_E_PATHNOTFOUND = static_cast<int32>(0x800A004C);
/// @brief
/// @brief Unable to find the specified file.
static constexpr int32 CTL_E_FILENOTFOUND = static_cast<int32>(0x800A0035);
/// @brief
static constexpr int32 FUSION_E_INVALID_NAME = static_cast<int32>(0x80131047);
Expand Down
32 changes: 16 additions & 16 deletions src/xtd.core/src/xtd/h_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,28 +253,28 @@ const std::unordered_map<int32, string>& h_result::get_messages() noexcept {
{COR_E_WAITHANDLECANNOTBEOPENED, "No handle of the given name exists."_t},
{CO_E_NOTINITIALIZED, "Not initialized"_t},
{DISP_E_PARAMNOTFOUND, "Could not find the parameter."_t},
{DISP_E_TYPEMISMATCH, ""_t},
{DISP_E_BADVARTYPE, ""_t},
{DISP_E_OVERFLOW, ""_t},
{DISP_E_DIVBYZERO, ""_t},
{DISP_E_TYPEMISMATCH, "Attempt to access a variable with an incompatible type."_t},
{DISP_E_BADVARTYPE, "Invalid virable 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},
{E_BOUNDS, ""_t},
{E_CHANGED_STATE, ""_t},
{E_BOUNDS, "Bounds exception"_t},
{E_CHANGED_STATE, "The state has been modified."_t},
{E_FILENOTFOUND, "Unable to find the specified file."_t},
{E_FAIL, "Unspecified failure."_t},
{E_HANDLE, ""_t},
{E_INVALIDARG, ""_t},
{E_HANDLE, "The handle is invalid."_t},
{E_INVALIDARG, "Value does not fall within the expected range."_t},
{E_NOTIMPL, "The method or operation is not implemented."_t},
{E_POINTER, "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."_t},
{E_UNEXPECTED, "Unexpected failure."_t},
{ERROR_MRM_MAP_NOT_FOUND, ""_t},
{ERROR_TIMEOUT, ""_t},
{RO_E_CLOSED, ""_t},
{RPC_E_CHANGED_MODE, ""_t},
{TYPE_E_TYPEMISMATCH, ""_t},
{STG_E_PATHNOTFOUND, ""_t},
{CTL_E_PATHNOTFOUND, ""_t},
{CTL_E_FILENOTFOUND, ""_t},
{ERROR_MRM_MAP_NOT_FOUND, "Resource map not found."_t},
{ERROR_TIMEOUT, "The operation has timed out."_t},
{RO_E_CLOSED, "The object has been closed."_t},
{RPC_E_CHANGED_MODE, "Cannot change the current thread mode."_t},
{TYPE_E_TYPEMISMATCH, "Incompatible type."_t},
{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},
Expand Down
28 changes: 14 additions & 14 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 @@ -838,15 +838,15 @@ namespace xtd::tests {
}

void test_method_(get_message_with_DISP_E_TYPEMISMATCH) {
assert::are_equal("", h_result::get_message(h_result::DISP_E_TYPEMISMATCH), csf_);
assert::are_equal("Attempt to access a variable with an incompatible type.", h_result::get_message(h_result::DISP_E_TYPEMISMATCH), csf_);
}

void test_method_(get_message_with_DISP_E_BADVARTYPE) {
assert::are_equal("", h_result::get_message(h_result::DISP_E_BADVARTYPE), csf_);
assert::are_equal("Invalid virable type.", h_result::get_message(h_result::DISP_E_BADVARTYPE), csf_);
}

void test_method_(get_message_with_DISP_E_OVERFLOW) {
assert::are_equal("", h_result::get_message(h_result::DISP_E_OVERFLOW), csf_);
assert::are_equal("Arithmetic operation resulted in an overflow.", h_result::get_message(h_result::DISP_E_OVERFLOW), csf_);
}

void test_method_(get_message_with_DISP_E_DIVBYZERO) {
Expand All @@ -858,11 +858,11 @@ namespace xtd::tests {
}

void test_method_(get_message_with_E_BOUNDS) {
assert::are_equal("", h_result::get_message(h_result::E_BOUNDS), csf_);
assert::are_equal("Bounds exception", h_result::get_message(h_result::E_BOUNDS), csf_);
}

void test_method_(get_message_with_E_CHANGED_STATE) {
assert::are_equal("", h_result::get_message(h_result::E_CHANGED_STATE), csf_);
assert::are_equal("The state has been modified.", h_result::get_message(h_result::E_CHANGED_STATE), csf_);
}

void test_method_(get_message_with_E_FILENOTFOUND) {
Expand All @@ -874,7 +874,7 @@ namespace xtd::tests {
}

void test_method_(get_message_with_E_HANDLE) {
assert::are_equal("", h_result::get_message(h_result::E_HANDLE), csf_);
assert::are_equal("The handle is invalid.", h_result::get_message(h_result::E_HANDLE), csf_);
}

void test_method_(get_message_with_E_INVALIDARG) {
Expand All @@ -894,35 +894,35 @@ namespace xtd::tests {
}

void test_method_(get_message_with_ERROR_MRM_MAP_NOT_FOUND) {
assert::are_equal("", h_result::get_message(h_result::ERROR_MRM_MAP_NOT_FOUND), csf_);
assert::are_equal("Resource map not found.", h_result::get_message(h_result::ERROR_MRM_MAP_NOT_FOUND), csf_);
}

void test_method_(get_message_with_ERROR_TIMEOUT) {
assert::are_equal("", h_result::get_message(h_result::ERROR_TIMEOUT), csf_);
assert::are_equal("The operation has timed out.", h_result::get_message(h_result::ERROR_TIMEOUT), csf_);
}

void test_method_(get_message_with_RO_E_CLOSED) {
assert::are_equal("", h_result::get_message(h_result::RO_E_CLOSED), csf_);
assert::are_equal("The object has been closed.", h_result::get_message(h_result::RO_E_CLOSED), csf_);
}

void test_method_(get_message_with_RPC_E_CHANGED_MODE) {
assert::are_equal("", h_result::get_message(h_result::RPC_E_CHANGED_MODE), csf_);
assert::are_equal("Cannot change the current thread mode.", h_result::get_message(h_result::RPC_E_CHANGED_MODE), csf_);
}

void test_method_(get_message_with_TYPE_E_TYPEMISMATCH) {
assert::are_equal("", h_result::get_message(h_result::TYPE_E_TYPEMISMATCH), csf_);
assert::are_equal("Incompatible type.", h_result::get_message(h_result::TYPE_E_TYPEMISMATCH), csf_);
}

void test_method_(get_message_with_STG_E_PATHNOTFOUND) {
assert::are_equal("", h_result::get_message(h_result::STG_E_PATHNOTFOUND), csf_);
assert::are_equal("Attempted to access a path that is not on the disk.", h_result::get_message(h_result::STG_E_PATHNOTFOUND), csf_);
}

void test_method_(get_message_with_CTL_E_PATHNOTFOUND) {
assert::are_equal("", h_result::get_message(h_result::CTL_E_PATHNOTFOUND), csf_);
assert::are_equal("Attempted to access a path that is not on the disk.", h_result::get_message(h_result::CTL_E_PATHNOTFOUND), csf_);
}

void test_method_(get_message_with_CTL_E_FILENOTFOUND) {
assert::are_equal("", h_result::get_message(h_result::CTL_E_FILENOTFOUND), csf_);
assert::are_equal("Unable to find the specified file.", h_result::get_message(h_result::CTL_E_FILENOTFOUND), csf_);
}

void test_method_(get_message_with_FUSION_E_INVALID_NAME) {
Expand Down

0 comments on commit b342ccb

Please sign in to comment.