static int initialized;
if (initialized) {
- __STC_LOG_FUNC_EXIT__;
- return SQLITE_OK;
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return SQLITE_OK; //LCOV_EXCL_LINE
}
PREPARE_DELETE(delete_restrictions, DELETE_RESTRICTIONS);
static int initialized;
if (initialized) {
- __STC_LOG_FUNC_EXIT__;
- return SQLITE_OK;
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return SQLITE_OK; //LCOV_EXCL_LINE
}
PREPARE_SELECT(select_restriction, SELECT_RESTRICTIONS);
static int initialized;
if (initialized) {
- __STC_LOG_FUNC_EXIT__;
- return SQLITE_OK;
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return SQLITE_OK; //LCOV_EXCL_LINE
}
PREPARE_UPDATE(update_net_restrictions, UPDATE_NET_RESTRICTIONS);
static int initialized;
if (initialized) {
- __STC_LOG_FUNC_EXIT__;
- return SQLITE_OK;
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return SQLITE_OK; //LCOV_EXCL_LINE
}
PREPARE_UPDATE(insert_net_restrictions, INSERT_NET_RESTRICTIONS);
sqlite3_stmt *stmt = select_restriction_per_app;
if (!app_id) {
- __STC_LOG_FUNC_EXIT__;
- return STC_ERROR_DB_FAILED;
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
}
DB_ACTION(sqlite3_bind_text(stmt, 1, app_id, -1,
data.restriction_id = sqlite3_column_int64(stmt, 8);
if (restriction_cb(&data, user_data) == STC_CANCEL)
- rc = SQLITE_DONE;
+ rc = SQLITE_DONE; //LCOV_EXCL_LINE
break;
case SQLITE_ERROR:
default:
- STC_LOGE("Failed to enumerate restrictions: %s\n",
+ STC_LOGE("Failed to enumerate restrictions: %s\n", //LCOV_EXCL_LINE
sqlite3_errmsg(stc_db_get_database()));
- __STC_LOG_FUNC_EXIT__;
- error_code = STC_ERROR_DB_FAILED;
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
}
} while (rc == SQLITE_ROW);
data.restriction_id = sqlite3_column_int64(stmt, 8);
if (restriction_cb(&data, user_data) == STC_CANCEL)
- rc = SQLITE_DONE;
+ rc = SQLITE_DONE; //LCOV_EXCL_LINE
break;
case SQLITE_ERROR:
default:
- STC_LOGE("Failed to enumerate restrictions: %s\n",
+ STC_LOGE("Failed to enumerate restrictions: %s\n", //LCOV_EXCL_LINE
sqlite3_errmsg(stc_db_get_database()));
- __STC_LOG_FUNC_EXIT__;
- error_code = STC_ERROR_DB_FAILED;
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
}
} while (rc == SQLITE_ROW);
bool state_subscriber_id = 0;
if (state == NULL) {
- STC_LOGE("Please provide valid argument!");
- __STC_LOG_FUNC_EXIT__;
- return STC_ERROR_INVALID_PARAMETER;
+ STC_LOGE("Please provide valid argument!"); //LCOV_EXCL_LINE
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
*state = STC_RESTRICTION_UNKNOWN;
break;
case SQLITE_ERROR:
default:
- STC_LOGE("Can't perform sql query: %s \n%s",
+ STC_LOGE("Can't perform sql query: %s \n%s", //LCOV_EXCL_LINE
SELECT_RESTRICTION_STATE,
sqlite3_errmsg(stc_db_get_database()));
- error_code = STC_ERROR_DB_FAILED;
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
}
handle_error:
SQLITE_TRANSIENT));
if (sqlite3_step(stmt) != SQLITE_DONE) {
- STC_LOGE("Failed to remove restrictions by network interface %s\n",
+ STC_LOGE("Failed to remove restrictions by network interface %s\n", //LCOV_EXCL_LINE
sqlite3_errmsg(stc_db_get_database()));
- error_code = STC_ERROR_DB_FAILED;
- goto handle_error;
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
+ goto handle_error; //LCOV_EXCL_LINE
}
STC_LOGD("Restriction deleted for app_id [%s]", app_id);
break;
case SQLITE_ERROR:
default:
- STC_LOGE("Failed to get restriction id: %s\n",
+ STC_LOGE("Failed to get restriction id: %s\n", //LCOV_EXCL_LINE
sqlite3_errmsg(stc_db_get_database()));
}
sqlite3_stmt *stmt = insert_net_restrictions;
if (!info) {
- error_code = STC_ERROR_INVALID_PARAMETER;
- goto handle_error;
+ error_code = STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
+ goto handle_error; //LCOV_EXCL_LINE
}
__get_restriction_id(info);
DB_ACTION(sqlite3_bind_int64(stmt, 9, info->restriction_id));
if (sqlite3_step(stmt) != SQLITE_DONE) {
- STC_LOGE("Failed to set network restriction: %s\n",
+ STC_LOGE("Failed to set network restriction: %s\n", //LCOV_EXCL_LINE
sqlite3_errmsg(stc_db_get_database()));
- error_code = STC_ERROR_DB_FAILED;
- goto handle_error;
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
+ goto handle_error; //LCOV_EXCL_LINE
}
if (info->restriction_id) {
stc_error_e error_code = STC_ERROR_NONE;
if (db == NULL) {
- __STC_LOG_FUNC_EXIT__;
- return STC_ERROR_FAIL;
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return STC_ERROR_FAIL; //LCOV_EXCL_LINE
}
DB_ACTION(__prepare_delete(db));