Added test printer for std::future_status.

Bug: 297082009
Test: run_zimperium_dev
Change-Id: I65904821de45a7d5bd515388dcaf9cace53a4893
(cherry picked from commit 61dd2b7951ace38a0710909928028144462db165)
This commit is contained in:
Alex Dale
2023-08-22 14:00:29 -07:00
committed by Robert Shih
parent c53047bd1b
commit 95917053f3
2 changed files with 23 additions and 0 deletions

View File

@@ -79,3 +79,20 @@ void PrintTo(const SystemState& state, std::ostream* os) {
}
} // namespace okp
} // namespace wvcdm
namespace std {
void PrintTo(future_status status, ostream* os) {
switch (status) {
case future_status::ready:
*os << "future_status::ready";
return;
case future_status::timeout:
*os << "future_status::timeout";
return;
case future_status::deferred:
*os << "future_status::deferred";
return;
}
*os << "<unknown(" << static_cast<int>(status) << ")>";
}
} // namespace std

View File

@@ -7,6 +7,7 @@
#ifndef CDM_TEST_PRINTERS_H_
#define CDM_TEST_PRINTERS_H_
#include <future>
#include <iostream>
#include "OEMCryptoCENC.h"
@@ -24,4 +25,9 @@ namespace okp {
void PrintTo(const SystemState& state, std::ostream* os);
} // namespace okp
} // namespace wvcdm
namespace std {
void PrintTo(future_status status, ostream* os);
} // namespace std
#endif // CDM_TEST_PRINTERS_H_