Print values in host byte order
Merge from widevine of http://go/wvgerrit/14361 In oemcrypto_test, we look at some control duration and control bits. These are stored in network byte order. However, it is easier to read error messages if they are converted to host byte order before printing them. Change-Id: I116b5f43957351b0e40e05331c282c248128903c
This commit is contained in:
@@ -883,10 +883,12 @@ class Session {
|
||||
if (sts != OEMCrypto_ERROR_NOT_IMPLEMENTED) {
|
||||
ASSERT_EQ(OEMCrypto_SUCCESS, sts);
|
||||
ASSERT_EQ(sizeof(block), size);
|
||||
ASSERT_EQ(license_.keys[i].control.duration,
|
||||
block.duration) << "For key " << i;
|
||||
ASSERT_EQ(license_.keys[i].control.control_bits,
|
||||
block.control_bits) << "For key " << i;
|
||||
// control duration and bits stored in network byte order. For printing
|
||||
// we change to host byte order.
|
||||
ASSERT_EQ(htonl(license_.keys[i].control.duration),
|
||||
htonl(block.duration)) << "For key " << i;
|
||||
ASSERT_EQ(htonl(license_.keys[i].control.control_bits),
|
||||
htonl(block.control_bits)) << "For key " << i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user