Turn on ODK tests in CE CDM test and fix test helper
Merge from Widevine repo of http://go/wvgerrit/122223 This adds the ODK unit tests to the CE CDM tests so that they run as part of the presubmit tests. The test helper had some pointer problems converting a bool to a uint32, so it has been updated to handle this correctly. Some other tests failed comparing signed to unsigned, to these have also been fixed. test: ran odk_test bug: 118657876 Change-Id: I744a1e89f4e4729c31d3f53e729984ffac1d96fd
This commit is contained in:
@@ -176,15 +176,15 @@ TEST(OdkTest, SerializeFieldsStress) {
|
||||
std::srand(0);
|
||||
size_t total_size = 0;
|
||||
for (int i = 0; i < n; i++) {
|
||||
fields[i].type = static_cast<ODK_FieldType>(std::rand() %
|
||||
static_cast<int>(ODK_NUMTYPES));
|
||||
fields[i].type = static_cast<ODK_FieldType>(
|
||||
std::rand() % static_cast<int>(ODK_LAST_STRESSABLE_TYPE));
|
||||
fields[i].value = malloc(ODK_AllocSize(fields[i].type));
|
||||
fields[i].name = "stress";
|
||||
total_size += ODK_FieldLength(fields[i].type);
|
||||
}
|
||||
|
||||
uint8_t* buf = new uint8_t[total_size]{};
|
||||
for (int i = 0; i < total_size; i++) {
|
||||
for (size_t i = 0; i < total_size; i++) {
|
||||
buf[i] = std::rand() & 0xff;
|
||||
}
|
||||
|
||||
@@ -701,7 +701,7 @@ TEST(OdkSizeTest, ReleaseRequest) {
|
||||
&core_message_length, &nonce_values,
|
||||
&clock_values, system_time_seconds));
|
||||
// Release requests do not have a core message.
|
||||
EXPECT_GE(core_message_length, 0);
|
||||
EXPECT_GE(core_message_length, 0u);
|
||||
}
|
||||
|
||||
TEST(OdkSizeTest, ProvisioningRequest) {
|
||||
|
||||
Reference in New Issue
Block a user