Fix static issues 75/257275/1
authorjusung <jusung07.son@samsung.com>
Thu, 22 Apr 2021 04:40:38 +0000 (13:40 +0900)
committerjusung <jusung07.son@samsung.com>
Thu, 22 Apr 2021 04:40:38 +0000 (13:40 +0900)
 - UNCAUGHT_EXCEPT
 - UNUSED_VALUE
 - BRANCH_PAST_INITIALIZATION

Change-Id: I5b3636d755cb2cff6c6d21ed8161ee1849842499
Signed-off-by: jusung <jusung07.son@samsung.com>
src/data_control_internal.c
tests/mock/test_fixture.h
tests/unit_tests/src/test_data_control_provider.cc

index d007146..8c5c3b5 100644 (file)
@@ -439,6 +439,7 @@ static int __recv_sql_select_process(bundle *kb, int fd,
        int result_fd = 0;
        guint nb;
        int retval = DATA_CONTROL_ERROR_NONE;
+       off_t row_offset;
 
        _LOGI("req_id : %s", req_id);
        _LOGI("SELECT RESPONSE");
@@ -614,7 +615,6 @@ static int __recv_sql_select_process(bundle *kb, int fd,
        _LOGI("resultset_content_offset : %lld",
                        (unsigned long long)cursor->resultset_content_offset);
 
-       off_t row_offset = 0;
        for (i = 0; i < row_count; i++) {
                row_offset = 0;
                for (j = 0; j < column_count; j++) {
index db223f1..8f1fb0e 100644 (file)
@@ -41,9 +41,6 @@ class TestFixture : public ::testing::Test {
   template <typename T>
   static T& GetMock() {
     auto ptr = dynamic_cast<T*>(mock_.get());
-    if (!ptr)
-      throw std::invalid_argument("The test does not provide mock of \"" +
-          std::string(typeid(T).name()) + "\"");
     return *ptr;
   }
 
index f504150..52047db 100644 (file)
@@ -418,7 +418,7 @@ TEST_F(DataControlProviderTest, provider_send_map_get_value_result_test) {
   char* value_list[2];
 
   value_list[0] = (char*)"val0";
-  value_list[0] = (char*)"val1";
+  value_list[1] = (char*)"val1";
 
   _register_sql_cb();