diff --git a/testing/test_util.cc b/testing/test_util.cc index 539d081..ad1f09c 100644 --- a/testing/test_util.cc +++ b/testing/test_util.cc @@ -10,6 +10,9 @@ #include #ifndef _MSC_VER #include // close() +#else +// Disable MSVC warnings that suggest making code non-portable. +#pragma warning(disable:4996) #endif #include @@ -28,7 +31,8 @@ namespace libwebm { namespace test { std::string GetTestDataDir() { - return std::getenv("LIBWEBM_TEST_DATA_PATH"); + const char* test_data_path = std::getenv("LIBWEBM_TEST_DATA_PATH"); + return test_data_path ? std::string(test_data_path) : std::string(); } std::string GetTestFilePath(const std::string& name) {