Commit 996dacac authored by fbarchard@google.com's avatar fbarchard@google.com

unittest first checks if files exists for neon detection.

BUG=315
TESTED=untested
R=nfullagar@chromium.org, wuwang@google.com

Review URL: https://webrtc-codereview.appspot.com/9589005

git-svn-id: http://libyuv.googlecode.com/svn/trunk@981 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent cb3344ae
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 980
Version: 981
License: BSD
License File: LICENSE
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 980
#define LIBYUV_VERSION 981
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
......@@ -92,16 +92,24 @@ TEST_F(libyuvTest, TestCpuId) {
}
#endif
static int FileExists(const char* file_name) {
FILE* f = fopen(file_name, "r");
if (!f) {
return 0;
}
fclose(f);
return 1;
}
TEST_F(libyuvTest, TestLinuxNeon) {
int testdata = ArmCpuCaps("unit_test/testdata/arm_v7.txt");
if (testdata) {
EXPECT_EQ(0, ArmCpuCaps("unit_test/testdata/arm_v7.txt"));
EXPECT_EQ(kCpuHasNEON, ArmCpuCaps("unit_test/testdata/tegra3.txt"));
if (FileExists("../../unit_test/testdata/arm_v7.txt")) {
EXPECT_EQ(0, ArmCpuCaps("../../unit_test/testdata/arm_v7.txt"));
EXPECT_EQ(kCpuHasNEON, ArmCpuCaps("../../unit_test/testdata/tegra3.txt"));
} else {
printf("WARNING: unable to load \"unit_test/testdata/arm_v7.txt\"\n");
printf("WARNING: unable to load \"../../unit_test/testdata/arm_v7.txt\"\n");
}
#if defined(__linux__) && defined(__ARM_NEON__)
EXPECT_NE(0, ArmCpuCaps("/proc/cpuinfo"));
EXPECT_EQ(kCpuHasNEON, ArmCpuCaps("/proc/cpuinfo"));
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment