test_util: Don't pass NULL to std::string() in GetTestDataDir().
Change-Id: Iaafa78a17580d962e260d9553b11d2cd3cb4726f Also: quiet MSVC warnings that suggest making code non-portable.
This commit is contained in:
@@ -10,6 +10,9 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
#include <unistd.h> // close()
|
#include <unistd.h> // close()
|
||||||
|
#else
|
||||||
|
// Disable MSVC warnings that suggest making code non-portable.
|
||||||
|
#pragma warning(disable:4996)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@@ -28,7 +31,8 @@ namespace libwebm {
|
|||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
std::string GetTestDataDir() {
|
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) {
|
std::string GetTestFilePath(const std::string& name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user