Example #1
0
int test_deinit(void)
{
    kaa_status_destroy(status);
    kaa_log_destroy(logger);

    return 0;
}
Example #2
0
static kaa_error_t kaa_context_destroy(kaa_context_t *context)
{
    KAA_RETURN_IF_NIL(context, KAA_ERR_BADPARAM);

    kaa_user_manager_destroy(context->user_manager);
#ifndef KAA_DISABLE_FEATURE_EVENTS
    kaa_event_manager_destroy(context->event_manager);
#endif
    kaa_profile_manager_destroy(context->profile_manager);
    kaa_bootstrap_manager_destroy(context->bootstrap_manager);
    kaa_channel_manager_destroy(context->channel_manager);
    kaa_status_destroy(context->status->status_instance);
    kaa_failover_strategy_destroy(context->failover_strategy);
    KAA_FREE(context->status);
#ifndef KAA_DISABLE_FEATURE_LOGGING
    kaa_log_collector_destroy(context->log_collector);
#endif
#ifndef KAA_DISABLE_FEATURE_CONFIGURATION
    kaa_configuration_manager_destroy(context->configuration_manager);
#endif
#ifndef KAA_DISABLE_FEATURE_NOTIFICATION
    kaa_notification_manager_destroy(context->notification_manager);
#endif
    kaa_platform_protocol_destroy(context->platform_protocol);
    KAA_FREE(context);
    return KAA_ERR_NONE;
}
Example #3
0
int test_deinit(void)
{
    kaa_channel_manager_destroy(channel_manager);
    kaa_status_destroy(status);
    kaa_log_destroy(logger);

    return 0;
}
Example #4
0
int test_deinit(void)
{
#ifndef KAA_DISABLE_FEATURE_CONFIGURATION
    kaa_status_destroy(status);
    kaa_configuration_manager_destroy(config_manager);
#endif
    kaa_log_destroy(logger);

    return 0;
}
Example #5
0
void test_status_persistense(void)
{
    KAA_TRACE_IN(logger);

    kaa_status_t *status;
    kaa_error_t err_code = kaa_status_create(&status);

    ASSERT_NULL(status->endpoint_access_token);
    ASSERT_EQUAL(status->event_seq_n, 0);
    ASSERT_FALSE(status->is_attached);
    ASSERT_FALSE(status->is_registered);
    ASSERT_FALSE(status->is_updated);

    ASSERT_EQUAL(kaa_status_set_endpoint_access_token(status, "my_token"), KAA_ERR_NONE);
    ASSERT_EQUAL(ext_copy_sha_hash(status->endpoint_public_key_hash, test_ep_key_hash), KAA_ERR_NONE);
    ASSERT_EQUAL(ext_copy_sha_hash(status->profile_hash, test_profile_hash), KAA_ERR_NONE);
    status->is_attached = true;
    status->is_registered = true;
    status->is_updated = true;
    status->event_seq_n = 10;

    err_code = kaa_status_save(status);
    ASSERT_EQUAL(err_code, KAA_ERR_NONE);

    kaa_status_destroy(status);
    status = NULL;


    err_code = kaa_status_create(&status);

    ASSERT_NOT_NULL(status->endpoint_access_token);
    ASSERT_EQUAL(strcmp("my_token", status->endpoint_access_token), 0);

    ASSERT_EQUAL(status->event_seq_n, 10);
    ASSERT_TRUE(status->is_attached);
    ASSERT_TRUE(status->is_registered);
    ASSERT_TRUE(status->is_updated);

    ASSERT_EQUAL(memcmp(test_ep_key_hash, status->endpoint_public_key_hash, SHA_1_DIGEST_LENGTH), 0);
    ASSERT_EQUAL(memcmp(test_profile_hash, status->profile_hash, SHA_1_DIGEST_LENGTH), 0);

    kaa_status_destroy(status);
}
Example #6
0
File: kaa.c Project: kaaproject/kaa
static kaa_error_t kaa_context_destroy(kaa_context_t *context)
{
    KAA_RETURN_IF_NIL(context, KAA_ERR_BADPARAM);

    kaa_channel_manager_destroy(context->channel_manager);
    kaa_status_destroy(context->status->status_instance);
    kaa_failover_strategy_destroy(context->failover_strategy);
    KAA_FREE(context->status);
    kaa_platform_protocol_destroy(context->platform_protocol);
    KAA_FREE(context);
    return KAA_ERR_NONE;
}
Example #7
0
void test_create_status(void)
{
    KAA_TRACE_IN(logger);

    kaa_status_t *status;
    kaa_error_t err_code = kaa_status_create(&status);

    ASSERT_EQUAL(err_code, KAA_ERR_NONE);
    ASSERT_NOT_NULL(status);

    kaa_status_destroy(status);
}