void assertMalwareInList(csr_cs_malware_list_h list, size_t count, const std::string &filepath)
{
- csr_cs_malware_h malware;
+ csr_cs_malware_h malware = nullptr;
for (size_t i = 0; i < count; i++) {
ASSERT_SUCCESS(csr_cs_malware_list_get_malware(list, i, &malware));
CHECK_IS_NOT_NULL(malware);
void assertMalwareNotInList(csr_cs_malware_list_h list, size_t count, const std::string &filepath)
{
- csr_cs_malware_h malware;
+ csr_cs_malware_h malware = nullptr;
for (size_t i = 0; i < count; i++) {
ASSERT_SUCCESS(csr_cs_malware_list_get_malware(list, i, &malware));
CHECK_IS_NOT_NULL(malware);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
unsigned char data[100] = {0, };
// no malware detected
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
unsigned char data[100] = {0, };
auto start_time = ::time(nullptr);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
unsigned char data[100] = {0, };
auto start_time = ::time(nullptr);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
unsigned char data[100] = {0, };
auto start_time = ::time(nullptr);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
unsigned char data[100] = {0, };
ASSERT_IF(csr_cs_scan_data(nullptr, data, sizeof(data), &detected),
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_FILE_NORMAL, &detected));
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
auto start_time = ::time(nullptr);
Test::touch_file_assert(TEST_FILE_HIGH);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
auto start_time = ::time(nullptr);
Test::touch_file_assert(TEST_FILE_MEDIUM);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
auto start_time = ::time(nullptr);
Test::touch_file_assert(TEST_FILE_LOW);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
auto start_time = ::time(nullptr);
Test::remove_file(TEST_FILE_MEDIA());
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
auto start_time = ::time(nullptr);
Test::remove_file(TEST_FILE_TMP);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
auto start_time = ::time(nullptr);
Test::uninstall_app(TEST_WGT_PKG_ID);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
auto start_time = ::time(nullptr);
Test::uninstall_app(TEST_TPK_PKG_ID);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
ASSERT_IF(csr_cs_scan_file(nullptr, TEST_FILE_NORMAL, &detected),
CSR_ERROR_INVALID_HANDLE);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
ASSERT_IF(csr_cs_scan_file(context, TEST_FILE_NO_EXIST, &detected),
CSR_ERROR_FILE_DO_NOT_EXIST);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
- csr_cs_malware_h stored;
+ csr_cs_malware_h detected = nullptr;
+ csr_cs_malware_h stored = nullptr;
ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_FILE_MEDIUM, &detected));
CHECK_IS_NOT_NULL(detected);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h stored;
+ csr_cs_malware_h stored = nullptr;
ASSERT_IF(csr_cs_get_detected_malware(nullptr, TEST_FILE_MEDIUM, &stored),
CSR_ERROR_INVALID_HANDLE);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h stored;
+ csr_cs_malware_h stored = nullptr;
ASSERT_SUCCESS(csr_cs_get_detected_malware(context, TEST_FILE_NO_EXIST, &stored));
CHECK_IS_NULL(stored);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_list_h detected_list;
- csr_cs_malware_h detected_high, detected_medium;
- csr_cs_malware_h stored;
+ csr_cs_malware_list_h detected_list = nullptr;
+ csr_cs_malware_h detected_high = nullptr;
+ csr_cs_malware_h detected_medium = nullptr;
+ csr_cs_malware_h stored = nullptr;
Test::ScopedCstr file_path_actual;
size_t cnt = 0;
size_t idx = 0;
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_list_h detected_list;
+ csr_cs_malware_list_h detected_list = nullptr;
size_t cnt = 0;
const char *dirs[1] = {
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_list_h detected_list;
+ csr_cs_malware_list_h detected_list = nullptr;
size_t cnt = 0;
const char *dirs[1] = {
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected, stored;
+ csr_cs_malware_h detected = nullptr;
+ csr_cs_malware_h stored = nullptr;
ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_FILE_HIGH, &detected));
CHECK_IS_NOT_NULL(detected);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h stored;
+ csr_cs_malware_h stored = nullptr;
ASSERT_IF(csr_cs_get_ignored_malware(nullptr, TEST_FILE_MEDIUM, &stored),
CSR_ERROR_INVALID_HANDLE);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h stored;
+ csr_cs_malware_h stored = nullptr;
ASSERT_SUCCESS(csr_cs_get_ignored_malware(context, TEST_FILE_NO_EXIST, &stored));
CHECK_IS_NULL(stored);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_list_h ignored_list;
- csr_cs_malware_h detected_high, detected_medium, stored;
+ csr_cs_malware_list_h ignored_list = nullptr;
+ csr_cs_malware_h detected_high = nullptr;
+ csr_cs_malware_h detected_medium = nullptr;
+ csr_cs_malware_h stored = nullptr;
size_t cnt = 0;
size_t idx = 0;
size_t compared_cnt = 0;
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_list_h ignored_list;
+ csr_cs_malware_list_h ignored_list = nullptr;
size_t cnt = 0;
const char *dirs[1] = {
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_list_h ignored_list;
+ csr_cs_malware_list_h ignored_list = nullptr;
size_t cnt = 0;
const char *dirs[1] = {
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected, stored;
+ csr_cs_malware_h detected = nullptr;
+ csr_cs_malware_h stored = nullptr;
// remove earlier test results
Test::copy_file(TEST_FILE_HIGH, TEST_FILE_MEDIA());
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
// scan and judge after touch
Test::copy_file(TEST_FILE_HIGH, TEST_FILE_MEDIA());
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected, stored;
+ csr_cs_malware_h detected = nullptr;
+ csr_cs_malware_h stored = nullptr;
// remove earlier test results
Test::copy_file(TEST_FILE_HIGH, TEST_FILE_MEDIA());
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected, stored;
+ csr_cs_malware_h detected = nullptr;
+ csr_cs_malware_h stored = nullptr;
// remove earlier test results
Test::copy_file(TEST_FILE_HIGH, TEST_FILE_MEDIA());
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
// remove old test data
Test::uninstall_app(TEST_WGT_PKG_ID);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
// remove old test data
Test::uninstall_app(TEST_TPK_PKG_ID);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_FILE_HIGH, &detected));
CHECK_IS_NOT_NULL(detected);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h malware;
+ csr_cs_malware_h malware = nullptr;
Test::remove_file(TEST_FILE_MEDIA());
Test::copy_file_assert(TEST_FILE_HIGH, TEST_FILE_MEDIA());
ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_FILE_MEDIA(), &malware));
CHECK_IS_NOT_NULL(malware);
- csr_cs_malware_h malware_stored;
+ csr_cs_malware_h malware_stored = nullptr;
ASSERT_SUCCESS(csr_cs_get_detected_malware(context, TEST_FILE_MEDIA(), &malware_stored));
CHECK_IS_NOT_NULL(malware_stored);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h malware;
+ csr_cs_malware_h malware = nullptr;
Test::remove_file(TEST_FILE_MEDIA());
Test::remove_file(TEST_FILE_TMP_IN_DIR_MALWARES);
TEST_DIR_MALWARES
};
- csr_cs_malware_list_h malware_list;
- size_t list_count;
+ csr_cs_malware_list_h malware_list = nullptr;
+ size_t list_count = 0;
ASSERT_SUCCESS(csr_cs_get_detected_malwares(context, dirs, 2, &malware_list, &list_count));
::assertMalwareInList(malware_list, list_count, TEST_FILE_MEDIA());
::assertMalwareInList(malware_list, list_count, TEST_FILE_TMP_IN_DIR_MALWARES);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h malware;
+ csr_cs_malware_h malware = nullptr;
Test::remove_file(TEST_FILE_MEDIA());
Test::copy_file_assert(TEST_FILE_HIGH, TEST_FILE_MEDIA());
ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_FILE_MEDIA(), &malware));
CHECK_IS_NOT_NULL(malware);
- csr_cs_malware_h malware_stored;
+ csr_cs_malware_h malware_stored = nullptr;
ASSERT_SUCCESS(csr_cs_get_detected_malware(context, TEST_FILE_MEDIA(), &malware_stored));
CHECK_IS_NOT_NULL(malware_stored);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h malware;
+ csr_cs_malware_h malware = nullptr;
Test::remove_file(TEST_FILE_MEDIA());
Test::remove_file(TEST_FILE_TMP_IN_DIR_MALWARES);
TEST_DIR_MALWARES
};
- csr_cs_malware_list_h malware_list;
- size_t list_count;
+ csr_cs_malware_list_h malware_list = nullptr;
+ size_t list_count = 0;
ASSERT_SUCCESS(csr_cs_get_detected_malwares(context, dirs, 2, &malware_list, &list_count));
::assertMalwareInList(malware_list, list_count, TEST_FILE_MEDIA());
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h malware;
+ csr_cs_malware_h malware = nullptr;
Test::remove_file(TEST_FILE_MEDIA());
Test::copy_file_assert(TEST_FILE_HIGH, TEST_FILE_MEDIA());
ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_FILE_MEDIA(), &malware));
CHECK_IS_NOT_NULL(malware);
- csr_cs_malware_h malware_stored;
+ csr_cs_malware_h malware_stored = nullptr;
ASSERT_SUCCESS(csr_cs_get_detected_malware(context, TEST_FILE_MEDIA(), &malware_stored));
CHECK_IS_NOT_NULL(malware_stored);
Test::copy_file_assert(TEST_FILE_HIGH, TEST_FILE_MEDIA());
Test::copy_file_assert(TEST_FILE_HIGH, TEST_FILE_TMP_IN_DIR_MALWARES);
- csr_cs_malware_h malware_tmp[2];
+ csr_cs_malware_h malware_tmp[2] = { nullptr, nullptr };
ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_FILE_MEDIA(), &malware_tmp[0]));
CHECK_IS_NOT_NULL(malware_tmp[0]);
ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_FILE_TMP_IN_DIR_MALWARES, &malware_tmp[1]));
TEST_DIR_MALWARES
};
- csr_cs_malware_list_h malware_list;
- size_t list_count;
+ csr_cs_malware_list_h malware_list = nullptr;
+ size_t list_count = 0;
ASSERT_SUCCESS(csr_cs_get_detected_malwares(context, dirs, 2, &malware_list, &list_count));
::assertMalwareInList(malware_list, list_count, TEST_FILE_MEDIA());
::assertMalwareInList(malware_list, list_count, TEST_FILE_TMP_IN_DIR_MALWARES);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h malware;
+ csr_cs_malware_h malware = nullptr;
Test::remove_file(TEST_FILE_MEDIA());
Test::copy_file_assert(TEST_FILE_HIGH, TEST_FILE_MEDIA());
ASSERT_SUCCESS(csr_cs_scan_file(context, TEST_FILE_MEDIA(), &malware));
CHECK_IS_NOT_NULL(malware);
- csr_cs_malware_h malware_stored;
+ csr_cs_malware_h malware_stored = nullptr;
ASSERT_SUCCESS(csr_cs_get_detected_malware(context, TEST_FILE_MEDIA(), &malware_stored));
CHECK_IS_NOT_NULL(malware_stored);
TEST_DIR_MALWARES
};
- csr_cs_malware_list_h malware_list;
- size_t list_count;
+ csr_cs_malware_list_h malware_list = nullptr;
+ size_t list_count = 0;
ASSERT_SUCCESS(csr_cs_get_detected_malwares(context, dirs, 2, &malware_list, &list_count));
::assertMalwareInList(malware_list, list_count, TEST_FILE_MEDIA());
::assertMalwareInList(malware_list, list_count, TEST_FILE_TMP_IN_DIR_MALWARES);
auto c = Test::Context<csr_cs_context_h>();
auto context = c.get();
- csr_cs_malware_h detected;
+ csr_cs_malware_h detected = nullptr;
Test::uninstall_app(TEST_WGT_PKG_ID);
ASSERT_INSTALL_APP(TEST_WGT_PATH, TEST_WGT_TYPE);