X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tests%2Fsst_gtest_normal_font.cpp;h=964bad9afd1d9cac729247c050ae49b82bbeee24;hb=eb81c294532468c1fbe38c157a360cc2a9b135a5;hp=a4272652d0ede7589a3e7ca1127279280c2043aa;hpb=014ec1f3d1434e204aed57d782396812c1ff5366;p=platform%2Fcore%2Fapi%2Fsystem-settings.git diff --git a/tests/sst_gtest_normal_font.cpp b/tests/sst_gtest_normal_font.cpp index a427265..964bad9 100644 --- a/tests/sst_gtest_normal_font.cpp +++ b/tests/sst_gtest_normal_font.cpp @@ -18,15 +18,25 @@ #include #include #include +#include #include "system_settings.h" #include "mocks/sstt_mock.h" +#define FONT_SCALE_CONF_PATH "conf_example/font_scale.json" extern "C" { #include "sst.h" #include "sst_font.h" #include "sst_vconf.h" #include "sst_interface.h" + +typedef struct __font_size_info { + int small; + int normal; + int large; + int huge; + int giant; +} font_size_info; } TEST(SstFontTest, getDefaultfontERR) @@ -137,6 +147,42 @@ TEST(SstFontTest, getFontType) free(val); } +static void* _utils_load_lib() +{ + const char* const path = SETTING_UTILS_SO_FILE_PATH; + void *handle = dlopen(path, RTLD_LAZY | RTLD_GLOBAL); + if (NULL == handle) + ERR("dlopen(%s) Fail", path); + + return handle; +} + +TEST(SstFontTest,loadFontSizeInfo) +{ + font_size_info info; + void *handle = _utils_load_lib(); + EXPECT_NE((void*)NULL, handle); + + typedef int (*fn_impl)(font_size_info *info, const char *path); + fn_impl load_font_size_info = NULL; + + load_font_size_info = (fn_impl)dlsym(handle, "load_font_size_info"); + char *error = dlerror(); + EXPECT_EQ(0, error); + + int ret = load_font_size_info(&info, FONT_SCALE_CONF_PATH); + EXPECT_EQ(0, ret); + + EXPECT_EQ(-80, info.small); + EXPECT_EQ(-150, info.large); + EXPECT_EQ(-100, info.normal); + EXPECT_EQ(-190, info.huge); + EXPECT_EQ(-250, info.giant); + + dlclose(handle); + handle = NULL; +} + TEST(SstFontTest, getDefaultfont) { char *val = NULL;