diff --git a/libwvdrmengine/cdm/core/test/test_base.cpp b/libwvdrmengine/cdm/core/test/test_base.cpp index decabfee..26d916fd 100644 --- a/libwvdrmengine/cdm/core/test/test_base.cpp +++ b/libwvdrmengine/cdm/core/test/test_base.cpp @@ -7,11 +7,12 @@ #include "test_base.h" #include - #include #include #include -#include +#include + +#include #include "cdm_engine.h" #include "crypto_session.h" @@ -204,9 +205,19 @@ void WvCdmTestBase::SetUp() { ::testing::Test::SetUp(); Properties::set_provisioning_messages_are_binary(binary_provisioning_); Properties::Init(); + // Log the current test name, to help with debugging when the log and stdout + // are not the same. const ::testing::TestInfo* const test_info = ::testing::UnitTest::GetInstance()->current_test_info(); LOGD("Running test %s.%s", test_info->test_case_name(), test_info->name()); + // Some test environments allow the model name of the device to be set + // dynamically using an environment variable. The model name will show up in + // the license server logs as the part of the device idenfication as + // "model_name". + std::stringstream ss; + ss << test_info->test_case_name() << "." << test_info->name(); + int overwrite = 1; // Set value even if already set. + setenv("MODEL_NAME", ss.str().c_str(), overwrite); CryptoSession::SetCryptoSessionFactory(new TestCryptoSessionFactory()); // TODO(fredgc): Add a test version of DeviceFiles. }