From: Zhang zhengguang Date: Thu, 19 Jun 2014 06:36:17 +0000 (+0800) Subject: Add test package for WiNet tethering CAPI X-Git-Tag: winet_tethering_0.1~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8cde9998d6158a7bbe8f3c550c79af4d7b91af6b;p=platform%2Fcore%2Fapi%2Ftethering.git Add test package for WiNet tethering CAPI Change-Id: I447eb43b99dea60063516c2feae51cf9d471bd2e --- diff --git a/packaging/capi-network-tethering.spec b/packaging/capi-network-tethering.spec index 3bef1a2..5c5453e 100644 --- a/packaging/capi-network-tethering.spec +++ b/packaging/capi-network-tethering.spec @@ -17,6 +17,13 @@ BuildRequires: cmake %description Tethering framework library for CAPI +%package test +Summary: Test case for tethering CAPI +Requires: %{name} = %{version} + +%description test +Test case for tethering CAPI. + %package devel Summary: Development package for Tethering framework library Group: Connectivity/Development @@ -64,6 +71,10 @@ cp LICENSE.APLv2.0 %{buildroot}/usr/share/license/%{name} %endif %endif +%files test +%manifest %{name}.manifest +%{_libdir}/winet-capi-test/capi-tethering-test + %files devel %manifest %{name}.manifest %defattr(-,root,root,-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7715cac..1e7b43c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(fw_test "${fw_name}-test") +SET(fw_test "capi-tethering-test") INCLUDE(FindPkgConfig) pkg_check_modules(${fw_test} REQUIRED glib-2.0) @@ -11,7 +11,8 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall") aux_source_directory(. sources) FOREACH(src ${sources}) GET_FILENAME_COMPONENT(src_name ${src} NAME_WE) - MESSAGE("${src_name}") - ADD_EXECUTABLE(${src_name} ${src}) - TARGET_LINK_LIBRARIES(${src_name} ${fw_name} ${${fw_test}_LDFLAGS}) + MESSAGE("${fw_test}") + ADD_EXECUTABLE(${fw_test} ${src}) + TARGET_LINK_LIBRARIES(${fw_test} ${fw_name} ${${fw_test}_LDFLAGS}) + INSTALL(TARGETS ${fw_test} DESTINATION ${LIB_INSTALL_DIR}/winet-capi-test/) ENDFOREACH() diff --git a/test/tethering_test.c b/test/tethering_test.c index 33578c6..d4d1181 100644 --- a/test/tethering_test.c +++ b/test/tethering_test.c @@ -594,6 +594,7 @@ gboolean input(GIOChannel *channel, GIOCondition condition, gpointer data) *param = '\0'; param++; + g_print("=====cmd: %s, parameter: %s=====\n", cmd, param); /* One parameter except type */ if (!strcmp(cmd, "get") && !strcmp(param, "data_usage")) { error = tethering_get_data_usage(th, __data_usage_cb, NULL); @@ -705,7 +706,7 @@ int main(int argc, char *argv[]) g_io_channel_set_flags(stdin_channel, G_IO_FLAG_APPEND | G_IO_FLAG_NONBLOCK, NULL); - g_io_add_watch(stdin_channel, G_IO_IN, input, (gpointer)th); + g_io_add_watch(stdin_channel, G_IO_IN, input, (gpointer)(&th)); print_menu();