Exemplo n.º 1
0
static CT_TEST_FIXTURE set_up(const char *const test_case_name)
{
    CT_TEST_FIXTURE fixture;
    int setup_ok = 1;
    CTLOG_STORE *ctlog_store = CTLOG_STORE_new();

    if (ctlog_store == NULL) {
        setup_ok = 0;
        fprintf(stderr, "Failed to create a new CT log store\n");
        goto end;
    }

    if (CTLOG_STORE_load_default_file(ctlog_store) != 1) {
        setup_ok = 0;
        fprintf(stderr, "Failed to load CT log list\n");
        goto end;
    }

    memset(&fixture, 0, sizeof(fixture));
    fixture.test_case_name = test_case_name;
    fixture.ctlog_store = ctlog_store;

end:
    if (!setup_ok) {
        exit(EXIT_FAILURE);
    }
    return fixture;
}
Exemplo n.º 2
0
static CT_TEST_FIXTURE set_up(const char *const test_case_name)
{
    CT_TEST_FIXTURE fixture;
    int setup_ok = 1;

    memset(&fixture, 0, sizeof(fixture));

    fixture.test_case_name = test_case_name;
    fixture.epoch_time_in_ms = 1473269626000; /* Sep 7 17:33:46 2016 GMT */
    fixture.ctlog_store = CTLOG_STORE_new();

    if (fixture.ctlog_store == NULL) {
        setup_ok = 0;
        fprintf(stderr, "Failed to create a new CT log store\n");
        goto end;
    }

    if (CTLOG_STORE_load_default_file(fixture.ctlog_store) != 1) {
        setup_ok = 0;
        fprintf(stderr, "Failed to load CT log list\n");
        goto end;
    }

end:
    if (!setup_ok) {
        CTLOG_STORE_free(fixture.ctlog_store);
        exit(EXIT_FAILURE);
    }
    return fixture;
}
Exemplo n.º 3
0
static CT_TEST_FIXTURE set_up(const char *const test_case_name)
{
    CT_TEST_FIXTURE fixture;
    int ok = 0;

    memset(&fixture, 0, sizeof(fixture));
    fixture.test_case_name = test_case_name;
    fixture.epoch_time_in_ms = 1473269626000; /* Sep 7 17:33:46 2016 GMT */
    if (!TEST_ptr(fixture.ctlog_store = CTLOG_STORE_new())
            || !TEST_int_eq(
                    CTLOG_STORE_load_default_file(fixture.ctlog_store), 1))
        goto end;
    ok = 1;

end:
    if (!ok) {
        CTLOG_STORE_free(fixture.ctlog_store);
        TEST_error("Failed to setup");
        exit(EXIT_FAILURE);
    }
    return fixture;
}