summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongsun Lee <ds73.lee@samsung.com>2016-07-07 14:40:20 +0900
committerDong Sun Lee <ds73.lee@samsung.com>2016-07-06 22:41:33 -0700
commitfa9f3e6548e73689795a9d31ceab86c8c1cf6071 (patch)
tree319d8c19276abe6ea3ebf3185452a16274a7b950
parent067623aa7360ba10377241f9588f161481cb0736 (diff)
downloadcsr-framework-fa9f3e6548e73689795a9d31ceab86c8c1cf6071.tar.gz
csr-framework-fa9f3e6548e73689795a9d31ceab86c8c1cf6071.tar.bz2
csr-framework-fa9f3e6548e73689795a9d31ceab86c8c1cf6071.zip
add TCs to raise TC coverage
Change-Id: Ie02eb0800ea785a706b2e551dc7308e882500ffa Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
-rw-r--r--test/test-api-content-screening.cpp30
-rw-r--r--test/test-api-engine-manager.cpp8
2 files changed, 38 insertions, 0 deletions
diff --git a/test/test-api-content-screening.cpp b/test/test-api-content-screening.cpp
index d2c29e2..240af4e 100644
--- a/test/test-api-content-screening.cpp
+++ b/test/test-api-content-screening.cpp
@@ -1296,6 +1296,7 @@ BOOST_AUTO_TEST_CASE(get_ignored_malwares_after_file_changed)
// TODO: below test case needs response from UI. It'll be turned on as default after
// write code of popup service stub
+// For measuring TC coverage, eneable these test cases.
#if 0
BOOST_AUTO_TEST_CASE(remove_failed_returns_detected_handle)
{
@@ -1317,6 +1318,35 @@ BOOST_AUTO_TEST_CASE(remove_failed_returns_detected_handle)
EXCEPTION_GUARD_END
}
+
+BOOST_AUTO_TEST_CASE(scan_file_wgt_dir_remove_app)
+{
+ EXCEPTION_GUARD_START
+
+ auto c = Test::Context<csr_cs_context_h>();
+ auto context = c.get();
+ csr_cs_malware_h detected;
+
+ Test::uninstall_app(TEST_WGT_PKG_ID);
+ ASSERT_INSTALL_APP(TEST_WGT_PATH, TEST_WGT_TYPE);
+
+ ASSERT_SUCCESS(csr_cs_set_core_usage(context, CSR_CS_CORE_USAGE_DEFAULT));
+ ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_WGT_MAL_FILE(), &detected));
+
+ ASSERT_SUCCESS(csr_cs_set_core_usage(context, CSR_CS_CORE_USAGE_ALL));
+ ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_WGT_MAL_FILE(), &detected));
+
+ ASSERT_SUCCESS(csr_cs_set_core_usage(context, CSR_CS_CORE_USAGE_HALF));
+ ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_WGT_MAL_FILE(), &detected));
+
+ ASSERT_SUCCESS(csr_cs_set_core_usage(context, CSR_CS_CORE_USAGE_SINGLE));
+ ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_WGT_MAL_FILE(), &detected));
+
+ ASSERT_SUCCESS(csr_cs_set_ask_user(context, CSR_CS_ASK_USER_YES));
+ ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_WGT_MAL_FILE(), &detected));
+
+ EXCEPTION_GUARD_END
+}
#endif
BOOST_AUTO_TEST_SUITE_END()
diff --git a/test/test-api-engine-manager.cpp b/test/test-api-engine-manager.cpp
index 7a4c217..fd9a6cc 100644
--- a/test/test-api-engine-manager.cpp
+++ b/test/test-api-engine-manager.cpp
@@ -78,6 +78,9 @@ BOOST_AUTO_TEST_CASE(fields_getters)
ASSERT_SUCCESS(csr_engine_get_version(e.get(), &dataVersion.ptr));
ASSERT_IF(dataVersion.ptr, std::string("0.0.1"));
+ time_t updatedTime;
+ ASSERT_SUCCESS(csr_engine_get_latest_update_time(e.get(), &updatedTime));
+
csr_activated_e activated;
ASSERT_SUCCESS(csr_engine_get_activated(e.get(), &activated));
ASSERT_IF(activated, CSR_ACTIVATED);
@@ -88,6 +91,8 @@ BOOST_AUTO_TEST_CASE(fields_getters)
ASSERT_SUCCESS(csr_engine_get_state(e.get(), &state));
ASSERT_IF(state, CSR_STATE_ENABLE);
+
+
EXCEPTION_GUARD_END
}
@@ -163,6 +168,9 @@ BOOST_AUTO_TEST_CASE(fields_getters)
ASSERT_SUCCESS(csr_engine_get_version(e.get(), &dataVersion.ptr));
ASSERT_IF(dataVersion.ptr, std::string("0.0.1"));
+ time_t updatedTime;
+ ASSERT_SUCCESS(csr_engine_get_latest_update_time(e.get(), &updatedTime));
+
csr_activated_e activated;
ASSERT_SUCCESS(csr_engine_get_activated(e.get(), &activated));
ASSERT_IF(activated, CSR_ACTIVATED);