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_query[0], DELETE_ALL);
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_for_period, SELECT_FOR_PERIOD);
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_INSERT(update_statistics_query, INSERT_VALUES);
return *details_stms[stm_index];
}
+//LCOV_EXCL_START
stc_error_e table_statistics_reset_first_n_entries(int num)
{
__STC_LOG_FUNC_ENTER__;
sqlite3_reset(delete_query[4]);
return error_code;
}
+//LCOV_EXCL_STOP
stc_error_e table_statistics_reset(const table_statistics_reset_rule *rule)
{
__STC_LOG_FUNC_ENTER__;
sqlite3_stmt *stmt;
stc_error_e error_code = STC_ERROR_NONE;
- int pos = 1;/* running through positions where to
+ int pos = 1; /* running through positions where to
bind parameters in the query */
if (!rule || !rule->interval) {
- __STC_LOG_FUNC_EXIT__;
- return STC_ERROR_INVALID_PARAMETER;
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
/* pick a statement depending on parameters.
DB_ACTION(sqlite3_bind_int64(stmt, pos++, rule->interval->to));
if (sqlite3_step(stmt) != SQLITE_DONE) {
- STC_LOGE("Failed to drop collected statistics.");
- error_code = STC_ERROR_DB_FAILED;
- __STC_LOG_FUNC_EXIT__;
- goto handle_error;
+ STC_LOGE("Failed to drop collected statistics."); //LCOV_EXCL_LINE
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ goto handle_error; //LCOV_EXCL_LINE
}
STC_LOGD("Entry deleted successfully.");
memset(&data, 0, sizeof(data));
if (!rule || !info_cb) {
- __STC_LOG_FUNC_EXIT__;
- return STC_ERROR_INVALID_PARAMETER;
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
/* pick a statement depending on parameters */
}
if (info_cb(&data, user_data) == STC_CANCEL)
- rc = SQLITE_DONE;/* emulate end of data */
+ rc = SQLITE_DONE; //LCOV_EXCL_LINE
__STC_LOG_FUNC_EXIT__;
break;
case SQLITE_DONE:
break;
case SQLITE_ERROR:
default:
- error_code = STC_ERROR_DB_FAILED;
- __STC_LOG_FUNC_EXIT__;
- break;
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ break; //LCOV_EXCL_LINE
}
} while (rc == SQLITE_ROW);
sqlite3_stmt *stmt;
stc_error_e error_code = STC_ERROR_NONE;
int rc;
- int pos = 1;/* running through positions
+ int pos = 1; /* running through positions
where to bind parameters in the query */
stc_db_tm_interval_s interval;
memset(&data, 0, sizeof(data));
if (!rule || !info_cb) {
- __STC_LOG_FUNC_EXIT__;
- return STC_ERROR_INVALID_PARAMETER;
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
/* pick a statement depending on parameters.
}
if (info_cb(&data, user_data) == STC_CANCEL)
- rc = SQLITE_DONE; /* emulate end of data */
+ rc = SQLITE_DONE; //LCOV_EXCL_LINE
__STC_LOG_FUNC_EXIT__;
break;
case SQLITE_DONE:
break;
case SQLITE_ERROR:
default:
- error_code = STC_ERROR_DB_FAILED;
- __STC_LOG_FUNC_EXIT__;
- break;
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ break; //LCOV_EXCL_LINE
}
} while (rc == SQLITE_ROW);
{
stc_error_e error_code = STC_ERROR_NONE;
sqlite3_stmt *stmt = update_statistics_query;
- stc_hw_net_protocol_type_e hw_net_protocol_type = STC_PROTOCOL_NONE;
+ stc_hw_net_protocol_type_e hw_net_protocol_type = STC_PROTOCOL_UNKNOWN;
if (!stat->rcv_count && !stat->snd_count) {
error_code = STC_ERROR_INVALID_PARAMETER;
stat->rcv_count = 0;
stat->snd_count = 0;
if (sqlite3_step(stmt) != SQLITE_DONE) {
- STC_LOGE("Failed to record appstat. %s",
+ STC_LOGE("Failed to record appstat. %s", //LCOV_EXCL_LINE
sqlite3_errmsg(stc_db_get_database()));
- error_code = STC_ERROR_DB_FAILED;
- __STC_LOG_FUNC_EXIT__;
- goto handle_error;
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ goto handle_error; //LCOV_EXCL_LINE
}
- STC_LOGD("App stat recorded [%s]", stat->app_id);
+ if (STC_DEBUG_LOG)
+ STC_LOGD("App stat recorded [%s]", stat->app_id);
handle_error:
sqlite3_reset(stmt);
stc_error_e error_code = STC_ERROR_NONE;
if (db == NULL) {
- __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(__prepare_delete(db));