Ejemplo n.º 1
0
TEST(PackageManager, CheckVersionInstalled)
{
    PackageManagerStub pm;
    PackageInfo info("230", PLATFORM_UNKNOWN, ARCH_ARMv7);
    pm.InstalledPackages.push_back(info);
    EXPECT_TRUE(pm.CheckVersionInstalled("230", PLATFORM_UNKNOWN, ARCH_ARMv7));
}
Ejemplo n.º 2
0
TEST(PackageManager, GetPackagePathForX86)
{
    PackageManagerStub pm;
    EXPECT_TRUE(pm.InstallVersion("230", PLATFORM_UNKNOWN, ARCH_X86));
    string path = pm.GetPackagePathByVersion("230", PLATFORM_UNKNOWN, ARCH_X86);
    EXPECT_STREQ("/data/data/org.opencv.lib_v23_x86/lib", path.c_str());
}
Ejemplo n.º 3
0
TEST(PackageManager, GetPackagePathForArmv5)
{
    PackageManagerStub pm;
    EXPECT_TRUE(pm.InstallVersion("243", PLATFORM_UNKNOWN, ARCH_ARMv5));
    string path = pm.GetPackagePathByVersion("243", PLATFORM_UNKNOWN, ARCH_ARMv5);
    EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv5/lib", path.c_str());
}
Ejemplo n.º 4
0
TEST(PackageManager, GetPackagePathForMips)
{
    PackageManagerStub pm;
    EXPECT_TRUE(pm.InstallVersion(2040000, PLATFORM_UNKNOWN, ARCH_MIPS));
    string path = pm.GetPackagePathByVersion(2040000, PLATFORM_UNKNOWN, ARCH_MIPS);
    EXPECT_STREQ("/data/data/org.opencv.lib_v24_mips/lib", path.c_str());
}
Ejemplo n.º 5
0
TEST(PackageManager, InstallVersion)
{
    PackageManagerStub pm;
    PackageInfo info("230", PLATFORM_UNKNOWN, ARCH_ARMv5);
    pm.InstalledPackages.push_back(info);
    EXPECT_TRUE(pm.InstallVersion("240", PLATFORM_UNKNOWN, ARCH_ARMv5));
    EXPECT_EQ(2, pm.InstalledPackages.size());
    EXPECT_TRUE(pm.CheckVersionInstalled("240", PLATFORM_UNKNOWN, ARCH_ARMv5));
}
Ejemplo n.º 6
0
TEST(PackageManager, InstalledVersions)
{
    PackageManagerStub pm;
    PackageInfo info("230", PLATFORM_UNKNOWN, ARCH_ARMv7);
    pm.InstalledPackages.push_back(info);
    std::set<string> versions = pm.GetInstalledVersions();
    EXPECT_EQ(1, versions.size());
    EXPECT_EQ("230", *versions.begin());
}
Ejemplo n.º 7
0
TEST(PackageManager, InstalledVersions)
{
    PackageManagerStub pm;
    PackageInfo info(2030000, PLATFORM_UNKNOWN, ARCH_ARMv7);
    pm.InstalledPackages.push_back(info);
    std::vector<int> versions = pm.GetInstalledVersions();
    EXPECT_EQ(1, versions.size());
    EXPECT_EQ(2030000, *versions.begin());
}
Ejemplo n.º 8
0
TEST(PackageManager, GetPackagePathForX86SSE2)
{
    PackageManagerStub pm;
    EXPECT_TRUE(pm.InstallVersion("230", PLATFORM_UNKNOWN, ARCH_X86 | FEATURES_HAS_SSE2));
    string path = pm.GetPackagePathByVersion("230", PLATFORM_UNKNOWN, ARCH_X86 | FEATURES_HAS_SSE2);
#ifdef __SUPPORT_INTEL_FEATURES
    EXPECT_STREQ("/data/data/org.opencv.lib_v23_x86_sse2/lib", path.c_str());
#else
    EXPECT_STREQ("/data/data/org.opencv.lib_v23_x86/lib", path.c_str());
#endif
}
Ejemplo n.º 9
0
TEST(PackageManager, GetPackagePathForArmv7Neon)
{
    PackageManagerStub pm;
    EXPECT_TRUE(pm.InstallVersion("230", PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_NEON));
    string path = pm.GetPackagePathByVersion("230", PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_NEON);
#ifdef __SUPPORT_ARMEABI_V7A_FEATURES
    EXPECT_STREQ("/data/data/org.opencv.lib_v23_armv7a_neon/lib", path.c_str());
#else
    EXPECT_STREQ("/data/data/org.opencv.lib_v23_armv7a/lib", path.c_str());
#endif
}
Ejemplo n.º 10
0
TEST(PackageManager, GetPackagePathForTegra3)
{
    PackageManagerStub pm;
    EXPECT_TRUE(pm.InstallVersion(2030000, PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON));
    string path = pm.GetPackagePathByVersion(2030000, PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON);
#ifdef __SUPPORT_TEGRA3
    EXPECT_STREQ("/data/data/org.opencv.lib_v23_tegra3/lib", path.c_str());
#else
#ifdef __SUPPORT_ARMEABI_V7A_FEATURES
    EXPECT_STREQ("/data/data/org.opencv.lib_v23_armv7a_neon/lib", path.c_str());
#else
    EXPECT_STREQ("/data/data/org.opencv.lib_v23_armv7a/lib", path.c_str());
#endif
#endif
}