Skip to content

Commit

Permalink
Assert on the StorePurchaseStatus enum translation
Browse files Browse the repository at this point in the history
Tests in the future would catch if more status are added to that enum,
forcing us to review and update.
  • Loading branch information
CarlosNihelton committed Sep 18, 2023
1 parent dbf440d commit 2822203
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion storeapi/base/impl/StoreContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@ PurchaseStatus translate(StorePurchaseStatus purchaseStatus) noexcept {
case StorePurchaseStatus::ServerError:
return PurchaseStatus::ServerError;
}
debug_assert(false, "Missing enum elements to translate StorePurchaseStatus.");
return StoreApi::PurchaseStatus::Unknown; // To be future proof.
}
} // namespace

} // namespace StoreApi::impl

#endif // UP4W_TEST_WITH_MS_STORE_MOCK
#endif // UP4W_TEST_WITH_MS_STORE_MOCK

0 comments on commit 2822203

Please sign in to comment.