Source release 14.2.0

This commit is contained in:
John W. Bruce
2018-10-12 19:55:47 -07:00
parent c32e8d0490
commit f51edaba5a
632 changed files with 196557 additions and 66444 deletions

View File

@@ -6,7 +6,6 @@
#include <getopt.h>
#include <gtest/gtest.h>
#include <time.h>
#include <stdio.h>
#if defined(__linux__)
#include <sys/utsname.h>
@@ -14,13 +13,10 @@
#include "cdm.h"
#include "device_cert.h"
#include "log.h"
#include "override.h"
#include "test_host.h"
#include "test_keybox.h"
#if defined(OEMCRYPTO_TESTS)
# include "oec_device_features.h"
#endif
#include "test_base.h"
using namespace widevine;
@@ -30,41 +26,7 @@ int main(int argc, char** argv) {
// Init gtest and let it consume arguments.
::testing::InitGoogleTest(&argc, argv);
// Parse arguments.
int show_usage = 0;
int opt;
int verbosity = 0;
while ((opt = getopt_long(argc, argv, "v", NULL, NULL)) != -1) {
switch (opt) {
case 'v':
++verbosity;
break;
case '?':
show_usage = 1;
break;
}
}
if (show_usage) {
fprintf(stderr, "Usage: %s [-v|-vv|-vvv]\n\n", argv[0]);
return 0;
}
{
FILE* outfile;
outfile = fopen("danger_do_not_use.bin", "w");
if (outfile == NULL) { return 0; }
if (fwrite(&wvcdm_test_auth::kValidKeybox01, 1,
sizeof(wvcdm_test_auth::kValidKeybox01), outfile) != 128) {
fclose(outfile);
return 0;
}
if (fwrite(&wvcdm_test_auth::kTestKeybox, 1,
sizeof(wvcdm_test_auth::kTestKeybox), outfile) != 128) {
fclose(outfile);
return 0;
}
fclose(outfile);
}
if (!wvcdm::WvCdmTestBase::Initialize(argc, argv)) return 0;
// Set up a Host so that tests and initialize the library. This makes these
// services available to the tests. We would do this in the test suite
@@ -91,17 +53,9 @@ int main(int argc, char** argv) {
Cdm::Status status = Cdm::initialize(
Cdm::kNoSecureOutput, client_info, g_host, g_host, g_host,
static_cast<Cdm::LogLevel>(verbosity));
static_cast<Cdm::LogLevel>(wvcdm::g_cutoff));
(void)status; // status is now used when assertions are turned off.
assert(status == Cdm::kSuccess);
#if defined(OEMCRYPTO_TESTS)
// Set up the OEMCrypto test harness.
wvoec::global_features.Initialize(false /* is_cast_receiver */,
false /* force_load_test_keybox */);
::testing::GTEST_FLAG(filter)
= wvoec::global_features.RestrictFilter(::testing::GTEST_FLAG(filter));
#endif
return RUN_ALL_TESTS();
}