Fix assert check on delta scan test 00/74900/2
authorKyungwook Tak <k.tak@samsung.com>
Thu, 16 Jun 2016 04:48:46 +0000 (13:48 +0900)
committerKyungwook Tak <k.tak@samsung.com>
Thu, 16 Jun 2016 04:50:50 +0000 (13:50 +0900)
To exclude probability of other file changed in the directory case,
checking scanned count more precisely.

Change-Id: If050ddf2b6eb6a1e453b8fa678a88357bf29e2b3
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
test/test-api-content-screening-async.cpp

index 6bd0997..95467f1 100644 (file)
@@ -701,7 +701,10 @@ BOOST_AUTO_TEST_CASE(delta_scan_basic)
        lRescan.unlock();
 
        // scanned, detected, completed, cancelled, error
-       ASSERT_CALLBACK(testRescanCtx, 0, -1, 1, 0, 0);
+       ASSERT_CALLBACK(testRescanCtx, -1, -1, 1, 0, 0);
+       BOOST_REQUIRE_MESSAGE(testBaseCtx.scannedCnt > testRescanCtx.scannedCnt,
+                       "Scan count of the base[" << testBaseCtx.scannedCnt <<
+                       "] should be bigger than the delta-scan[" << testRescanCtx.scannedCnt << "]");
 
        ASSERT_DETECTED_IN_LIST(testRescanCtx.detectedList, TEST_WGT_APP_ROOT(),
                                                        MALWARE_HIGH_NAME, MALWARE_HIGH_SEVERITY,
@@ -731,7 +734,7 @@ BOOST_AUTO_TEST_CASE(delta_scan_basic)
        lRescanSub.unlock();
 
        // scanned, detected, completed, cancelled, error
-       ASSERT_CALLBACK(testRescanSubCtx, 0, -1, 1, 0, 0);
+       ASSERT_CALLBACK(testRescanSubCtx, 0, 1, 1, 0, 0);
 
        ASSERT_DETECTED_IN_LIST(testRescanSubCtx.detectedList, TEST_WGT_APP_ROOT(),
                                                        MALWARE_HIGH_NAME, MALWARE_HIGH_SEVERITY,
@@ -787,6 +790,8 @@ BOOST_AUTO_TEST_CASE(delta_scan_changed_after_scan)
 
        // scanned, detected, completed, cancelled, error
        ASSERT_CALLBACK(testRescanCtx, -1, -1, 1, 0, 0);
+       BOOST_REQUIRE_MESSAGE(testRescanCtx.scannedCnt >= 1,
+                       "reinstalled app(non-malicious wgt) should be counted in scanned.");
 
        ASSERT_DETECTED_IN_LIST(testRescanCtx.detectedList,
                TEST_WGT_APP_ROOT(), MALWARE_HIGH_NAME, MALWARE_HIGH_SEVERITY, MALWARE_HIGH_DETAILED_URL);