2012-06-21 22:50:05 +08:00
|
|
|
#include "IOpenCVEngine.h"
|
|
|
|
#include "EngineCommon.h"
|
|
|
|
#include "OpenCVEngine.h"
|
|
|
|
#include "IPackageManager.h"
|
|
|
|
#include "PackageManagerStub.h"
|
|
|
|
#include "PackageInfo.h"
|
|
|
|
#include "HardwareDetector.h"
|
|
|
|
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
#include <binder/IPCThreadState.h>
|
|
|
|
#include <binder/ProcessState.h>
|
|
|
|
#include <binder/IServiceManager.h>
|
|
|
|
#include <utils/Log.h>
|
|
|
|
|
|
|
|
using namespace android;
|
|
|
|
|
|
|
|
class ServiceStarter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ServiceStarter()
|
|
|
|
{
|
2013-11-22 15:12:51 +08:00
|
|
|
PackageManager = new PackageManagerStub();
|
|
|
|
Engine = new OpenCVEngine(PackageManager);
|
2012-10-17 07:18:30 +08:00
|
|
|
|
2013-11-22 15:12:51 +08:00
|
|
|
defaultServiceManager()->addService(IOpenCVEngine::descriptor, Engine);
|
|
|
|
LOGI("OpenCVEngine native service started successfully");
|
|
|
|
ProcessState::self()->startThreadPool();
|
2012-06-21 22:50:05 +08:00
|
|
|
}
|
|
|
|
~ServiceStarter()
|
|
|
|
{
|
2013-11-22 15:12:51 +08:00
|
|
|
delete PackageManager;
|
2012-06-21 22:50:05 +08:00
|
|
|
}
|
2012-07-11 21:30:41 +08:00
|
|
|
|
2012-06-21 22:50:05 +08:00
|
|
|
PackageManagerStub* PackageManager;
|
|
|
|
sp<IBinder> Engine;
|
|
|
|
};
|
|
|
|
|
2012-10-02 19:02:04 +08:00
|
|
|
static ServiceStarter Starter;
|
2012-06-21 22:50:05 +08:00
|
|
|
|
|
|
|
sp<IOpenCVEngine> InitConnect()
|
|
|
|
{
|
|
|
|
sp<IServiceManager> ServiceManager = defaultServiceManager();
|
|
|
|
sp<IBinder> EngineService;
|
|
|
|
sp<IOpenCVEngine> Engine;
|
2012-10-02 19:02:04 +08:00
|
|
|
|
2012-06-21 22:50:05 +08:00
|
|
|
do
|
|
|
|
{
|
2013-11-22 15:12:51 +08:00
|
|
|
EngineService = ServiceManager->getService(IOpenCVEngine::descriptor);
|
|
|
|
if (EngineService != 0) break;
|
|
|
|
usleep(500000); // 0.5 s
|
2012-06-21 22:50:05 +08:00
|
|
|
} while(true);
|
2012-10-02 19:02:04 +08:00
|
|
|
|
2012-06-21 22:50:05 +08:00
|
|
|
Engine = interface_cast<IOpenCVEngine>(EngineService);
|
2012-10-02 19:02:04 +08:00
|
|
|
|
2012-06-21 22:50:05 +08:00
|
|
|
return Engine;
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(OpenCVEngineTest, GetVersion)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
int32_t Version = Engine->GetVersion();
|
|
|
|
EXPECT_EQ(OPEN_CV_ENGINE_VERSION, Version);
|
|
|
|
}
|
|
|
|
|
2012-10-02 19:02:04 +08:00
|
|
|
#if defined(__i386__)
|
|
|
|
TEST(OpenCVEngineTest, GetPathForExecHWExistVersion)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
2013-01-18 22:33:04 +08:00
|
|
|
Starter.PackageManager->InstallVersion(2040000, PLATFORM_UNKNOWN, ARCH_X86);
|
2012-10-02 19:02:04 +08:00
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
|
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_x86/lib", String8(result).string());
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(OpenCVEngineTest, GetPathForExecHWOldVersion)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
2013-01-18 22:33:04 +08:00
|
|
|
Starter.PackageManager->InstallVersion(2040200, PLATFORM_UNKNOWN, ARCH_X86);
|
2012-10-02 19:02:04 +08:00
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4.1"));
|
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_x86/lib", String8(result).string());
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(OpenCVEngineTest, GetPathForExecHWNewVersion)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
2013-01-18 22:33:04 +08:00
|
|
|
Starter.PackageManager->InstallVersion(2040100, PLATFORM_UNKNOWN, ARCH_X86);
|
2012-10-02 19:02:04 +08:00
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4.2"));
|
|
|
|
EXPECT_EQ(0, result.size());
|
|
|
|
}
|
|
|
|
|
|
|
|
#elif defined (__mips)
|
|
|
|
TEST(OpenCVEngineTest, GetPathForExecHWExistVersion)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
2013-01-18 22:33:04 +08:00
|
|
|
Starter.PackageManager->InstallVersion(2040000, PLATFORM_UNKNOWN, ARCH_MIPS);
|
2012-10-02 19:02:04 +08:00
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
|
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_mips/lib", String8(result).string());
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(OpenCVEngineTest, GetPathForExecHWOldVersion)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
2013-01-18 22:33:04 +08:00
|
|
|
Starter.PackageManager->InstallVersion(2040200, PLATFORM_UNKNOWN, ARCH_MIPS);
|
2012-10-02 19:02:04 +08:00
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4.1"));
|
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_mips/lib", String8(result).string());
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(OpenCVEngineTest, GetPathForExecHWNewVersion)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
2013-01-18 22:33:04 +08:00
|
|
|
Starter.PackageManager->InstallVersion(2040100, PLATFORM_UNKNOWN, ARCH_MIPS);
|
2012-10-02 19:02:04 +08:00
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4.2"));
|
|
|
|
EXPECT_EQ(0, result.size());
|
|
|
|
}
|
|
|
|
|
2012-10-24 16:47:43 +08:00
|
|
|
#else // armeabi
|
2012-07-11 21:30:41 +08:00
|
|
|
TEST(OpenCVEngineTest, GetPathForExecHWExistVersion)
|
2012-06-21 22:50:05 +08:00
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
2012-07-11 21:30:41 +08:00
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
2013-01-18 22:33:04 +08:00
|
|
|
Starter.PackageManager->InstallVersion(2040000, PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON);
|
2012-06-21 22:50:05 +08:00
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
2012-07-11 21:30:41 +08:00
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
|
2012-10-02 19:02:04 +08:00
|
|
|
#ifdef __SUPPORT_TEGRA3
|
2012-07-11 21:30:41 +08:00
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_tegra3/lib", String8(result).string());
|
2012-10-02 19:02:04 +08:00
|
|
|
#else
|
2012-07-11 21:30:41 +08:00
|
|
|
#ifdef __SUPPORT_ARMEABI_V7A_FEATURES
|
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a_neon/lib", String8(result).string());
|
|
|
|
#else
|
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
|
|
|
|
#endif
|
2012-10-02 19:02:04 +08:00
|
|
|
#endif
|
2012-06-21 22:50:05 +08:00
|
|
|
}
|
|
|
|
|
2012-07-11 21:30:41 +08:00
|
|
|
TEST(OpenCVEngineTest, GetPathForExecHWOldVersion)
|
2012-06-21 22:50:05 +08:00
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
2012-07-11 21:30:41 +08:00
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
2013-01-18 22:33:04 +08:00
|
|
|
Starter.PackageManager->InstallVersion(2040200, PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON);
|
2012-06-21 22:50:05 +08:00
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
2012-07-11 21:30:41 +08:00
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4.1"));
|
2012-10-02 19:02:04 +08:00
|
|
|
#ifdef __SUPPORT_TEGRA3
|
2012-07-11 21:30:41 +08:00
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_tegra3/lib", String8(result).string());
|
2012-10-02 19:02:04 +08:00
|
|
|
#else
|
2012-07-11 21:30:41 +08:00
|
|
|
#ifdef __SUPPORT_ARMEABI_V7A_FEATURES
|
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a_neon/lib", String8(result).string());
|
|
|
|
#else
|
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
|
|
|
|
#endif
|
2012-10-02 19:02:04 +08:00
|
|
|
#endif
|
2012-07-11 21:30:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST(OpenCVEngineTest, GetPathForExecHWNewVersion)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
2013-01-18 22:33:04 +08:00
|
|
|
Starter.PackageManager->InstallVersion(2040100, PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_NEON);
|
2012-07-11 21:30:41 +08:00
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
2012-07-12 16:02:41 +08:00
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4.2"));
|
2012-07-11 21:30:41 +08:00
|
|
|
EXPECT_EQ(0, result.size());
|
2012-06-21 22:50:05 +08:00
|
|
|
}
|
|
|
|
|
2012-07-12 19:50:40 +08:00
|
|
|
TEST(OpenCVEngineTest, GetPathForCompatiblePackage1)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
2013-01-18 22:33:04 +08:00
|
|
|
Starter.PackageManager->InstallVersion(2040200, PLATFORM_UNKNOWN, ARCH_ARMv5);
|
2012-07-12 19:50:40 +08:00
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
2012-10-02 19:02:04 +08:00
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
|
2012-07-12 19:50:40 +08:00
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv5/lib", String8(result).string());
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(OpenCVEngineTest, GetPathForCompatiblePackage2)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
2013-01-18 22:33:04 +08:00
|
|
|
Starter.PackageManager->InstallVersion(2040200, PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON);
|
2012-07-12 19:50:40 +08:00
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
|
|
|
|
#ifdef __SUPPORT_TEGRA3
|
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_tegra3/lib", String8(result).string());
|
|
|
|
#else
|
2013-11-22 17:59:36 +08:00
|
|
|
# ifdef __SUPPORT_ARMEABI_V7A_FEATURES
|
2012-07-12 19:50:40 +08:00
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a_neon/lib", String8(result).string());
|
2013-11-22 17:59:36 +08:00
|
|
|
# else
|
2012-07-12 19:50:40 +08:00
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
|
2013-11-22 17:59:36 +08:00
|
|
|
# endif
|
2012-07-12 19:50:40 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2013-03-18 16:12:17 +08:00
|
|
|
TEST(OpenCVEngineTest, GetPathForCompatiblePackage3)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
2013-11-22 17:59:36 +08:00
|
|
|
Starter.PackageManager->InstallVersion(2040400, PLATFORM_TEGRA4, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_VFPv4 | FEATURES_HAS_NEON);
|
2013-03-18 16:12:17 +08:00
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
|
2013-11-22 17:59:36 +08:00
|
|
|
#ifdef __SUPPORT_TEGRA3
|
2013-03-18 16:12:17 +08:00
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_tegra4/lib", String8(result).string());
|
2013-11-22 17:59:36 +08:00
|
|
|
#else
|
|
|
|
# ifdef __SUPPORT_ARMEABI_V7A_FEATURES
|
2013-03-18 16:12:17 +08:00
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a_neon/lib", String8(result).string());
|
2013-11-22 17:59:36 +08:00
|
|
|
# else
|
2013-03-18 16:12:17 +08:00
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
|
2013-11-22 17:59:36 +08:00
|
|
|
# endif
|
|
|
|
#endif
|
2013-03-18 16:12:17 +08:00
|
|
|
}
|
|
|
|
|
2012-10-02 19:02:04 +08:00
|
|
|
TEST(OpenCVEngineTest, InstallAndGetVersion)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
EXPECT_TRUE(Engine->InstallVersion(String16("2.4")));
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
|
2013-11-22 17:59:36 +08:00
|
|
|
#ifdef __SUPPORT_TEGRA3
|
2012-10-02 19:02:04 +08:00
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_tegra3/lib", String8(result).string());
|
2013-11-22 17:59:36 +08:00
|
|
|
#else
|
|
|
|
# ifdef __SUPPORT_ARMEABI_V7A_FEATURES
|
2012-10-02 19:02:04 +08:00
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a_neon/lib", String8(result).string());
|
2013-11-22 17:59:36 +08:00
|
|
|
# else
|
2012-10-02 19:02:04 +08:00
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
|
2013-11-22 17:59:36 +08:00
|
|
|
# endif
|
|
|
|
#endif
|
2012-10-02 19:02:04 +08:00
|
|
|
}
|
2013-02-25 19:34:06 +08:00
|
|
|
|
|
|
|
TEST(OpenCVEngineTest, GetPathFor2_4_2)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
|
|
|
Starter.PackageManager->InstallVersion(2040200, PLATFORM_UNKNOWN, ARCH_ARMv7);
|
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4.2"));
|
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(OpenCVEngineTest, GetPathFor2_4_3)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
|
|
|
Starter.PackageManager->InstallVersion(2040300, PLATFORM_UNKNOWN, ARCH_ARMv7);
|
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4.3"));
|
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(OpenCVEngineTest, GetPathFor2_4_3_1)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
|
|
|
Starter.PackageManager->InstallVersion(2040301, PLATFORM_UNKNOWN, ARCH_ARMv7);
|
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4.3.1"));
|
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(OpenCVEngineTest, GetPathFor2_4_3_2)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
|
|
|
Starter.PackageManager->InstallVersion(2040302, PLATFORM_UNKNOWN, ARCH_ARMv7);
|
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4.3.2"));
|
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(OpenCVEngineTest, GetPathFor2_4_4)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
|
|
|
Starter.PackageManager->InstallVersion(2040400, PLATFORM_UNKNOWN, ARCH_ARMv7);
|
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4.4"));
|
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(OpenCVEngineTest, GetPathFor2_4_5)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
|
|
|
Starter.PackageManager->InstallVersion(2040500, PLATFORM_UNKNOWN, ARCH_ARMv7);
|
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4.5"));
|
2013-04-04 19:50:36 +08:00
|
|
|
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
|
2013-02-25 19:34:06 +08:00
|
|
|
}
|
2012-10-02 19:02:04 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __i386__
|
2012-07-12 19:50:40 +08:00
|
|
|
TEST(OpenCVEngineTest, GetPathForInCompatiblePackage1)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
2013-01-18 22:33:04 +08:00
|
|
|
Starter.PackageManager->InstallVersion(2040200, PLATFORM_UNKNOWN, ARCH_X64);
|
2012-07-12 19:50:40 +08:00
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
2012-10-02 19:02:04 +08:00
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
|
2012-07-12 19:50:40 +08:00
|
|
|
EXPECT_EQ(0, result.size());
|
|
|
|
}
|
2012-10-02 19:02:04 +08:00
|
|
|
#else
|
|
|
|
TEST(OpenCVEngineTest, GetPathForInCompatiblePackage1)
|
2012-06-21 22:50:05 +08:00
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
2012-07-12 16:02:41 +08:00
|
|
|
Starter.PackageManager->InstalledPackages.clear();
|
2013-01-18 22:33:04 +08:00
|
|
|
Starter.PackageManager->InstallVersion(2040200, PLATFORM_UNKNOWN, ARCH_ARMv7);
|
2012-06-21 22:50:05 +08:00
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
2012-07-11 21:30:41 +08:00
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
|
2012-10-02 19:02:04 +08:00
|
|
|
EXPECT_EQ(0, result.size());
|
|
|
|
}
|
2012-07-11 21:30:41 +08:00
|
|
|
#endif
|
2012-10-02 19:02:04 +08:00
|
|
|
|
|
|
|
TEST(OpenCVEngineTest, GetPathForUnExistVersion)
|
|
|
|
{
|
|
|
|
sp<IOpenCVEngine> Engine = InitConnect();
|
|
|
|
EXPECT_FALSE(NULL == Engine.get());
|
|
|
|
String16 result = Engine->GetLibPathByVersion(String16("2.5"));
|
|
|
|
EXPECT_EQ(0, result.size());
|
2013-01-18 22:33:04 +08:00
|
|
|
}
|