From 36d4c4c4b794e596c2667f93d1f2115eb0a5ee43 Mon Sep 17 00:00:00 2001 From: Fred Gylys-Colwell Date: Mon, 21 Aug 2023 21:24:42 -0700 Subject: [PATCH] Pretty print BuildInformation in unit tests Change-Id: I1f702edc731454c84667c79e05c94b4360a40111 --- libwvdrmengine/oemcrypto/test/oemcrypto_basic_test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_basic_test.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_basic_test.cpp index 736e56ef..365cfec4 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_basic_test.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_basic_test.cpp @@ -227,6 +227,13 @@ TEST_F(OEMCryptoClientTest, VersionNumber) { if (build_info.size() != buf_length) { build_info.resize(buf_length); } + const std::string comma = ","; + const std::string pretty_comma = ",\n "; + std::string::size_type pos = 0; + while ((pos = build_info.find(comma, pos)) != std::string::npos) { + build_info.replace(pos, comma.size(), pretty_comma); + pos += pretty_comma.size(); + } cout << " BuildInformation: " << build_info << endl; OEMCrypto_WatermarkingSupport support = OEMCrypto_GetWatermarkingSupport(); cout << " WatermarkingSupport: " << support << endl;