deps/libssh-0.6.3/tests/unittests/torture_keyfiles.c
static void torture_privatekey_from_file(void **state) {
    ssh_session session = *state;
    ssh_private_key key = NULL;

    key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, SSH_KEYTYPE_RSA, NULL);
    assert_true(key != NULL);
    if (key != NULL) {
        privatekey_free(key);
        key = NULL;
    }

    key = privatekey_from_file(session, LIBSSH_DSA_TESTKEY, SSH_KEYTYPE_DSS, NULL);
    assert_true(key != NULL);
    if (key != NULL) {
        privatekey_free(key);
        key = NULL;
    }

    /* Test the automatic type discovery */
    key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, 0, NULL);
    assert_true(key != NULL);
    if (key != NULL) {
        privatekey_free(key);
        key = NULL;
    }

    key = privatekey_from_file(session, LIBSSH_DSA_TESTKEY, 0, NULL);
    assert_true(key != NULL);
    if (key != NULL) {
        privatekey_free(key);
        key = NULL;
    }
}
/**
 * @brief tests the privatekey_from_file function without passphrase
 */
@brief tests the privatekey_from_file function without passphrase
@brief tests the privatekey_from_file function without passphrase
static void torture_privatekey_from_file(void **state) {
    ssh_session session = *state;
    ssh_private_key key = NULL;
    key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, SSH_KEYTYPE_RSA, NULL);
    assert_true(key != NULL);
    if (key != NULL) {
        privatekey_free(key);
        key = NULL;
    }
    key = privatekey_from_file(session, LIBSSH_DSA_TESTKEY, SSH_KEYTYPE_DSS, NULL);
    assert_true(key != NULL);
    if (key != NULL) {
        privatekey_free(key);
        key = NULL;
    }
    key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, 0, NULL);
    assert_true(key != NULL);
    if (key != NULL) {
        privatekey_free(key);
        key = NULL;
    }
    key = privatekey_from_file(session, LIBSSH_DSA_TESTKEY, 0, NULL);
    assert_true(key != NULL);
    if (key != NULL) {
        privatekey_free(key);
        key = NULL;
    }
}
static void torture_privatekey_from_file ( void * * state ) { ssh_session session = * state ; ssh_private_key key = NULL ; key = privatekey_from_file ( session , LIBSSH_RSA_TESTKEY , SSH_KEYTYPE_RSA , NULL ) ; assert_true ( key != NULL ) ; if ( key != NULL ) { privatekey_free ( key ) ; key = NULL ; } key = privatekey_from_file ( session , LIBSSH_DSA_TESTKEY , SSH_KEYTYPE_DSS , NULL ) ; assert_true ( key != NULL ) ; if ( key != NULL ) { privatekey_free ( key ) ; key = NULL ; } key = privatekey_from_file ( session , LIBSSH_RSA_TESTKEY , 0 , NULL ) ; assert_true ( key != NULL ) ; if ( key != NULL ) { privatekey_free ( key ) ; key = NULL ; } key = privatekey_from_file ( session , LIBSSH_DSA_TESTKEY , 0 , NULL ) ; assert_true ( key != NULL ) ; if ( key != NULL ) { privatekey_free ( key ) ; key = NULL ; } }
@brief tests the privatekey_from_file function without passphrase
@brief tests the privatekey_from_file function without passphrase
/* Test the automatic type discovery */