OpenVPN
|
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <database.h>
Go to the source code of this file.
Functions | |
DatabaseConnection * | connect_to_customer_database () |
unsigned int | get_customer_id_by_name (DatabaseConnection *const connection, const char *const customer_name) |
static unsigned int | mock_query_database (DatabaseConnection *const connection, const char *const query_string, void ***const results) |
DatabaseConnection * | connect_to_database (const char *const database_url, const unsigned int port) |
static void | test_connect_to_customer_database (void **state) |
static void | test_get_customer_id_by_name (void **state) |
int | main (void) |
DatabaseConnection* connect_to_customer_database | ( | ) |
Definition at line 29 of file customer_database.c.
References connect_to_database().
Referenced by test_connect_to_customer_database().
DatabaseConnection* connect_to_database | ( | const char *const | database_url, |
const unsigned int | port | ||
) |
Definition at line 38 of file customer_database_test.c.
Referenced by connect_to_customer_database(), connect_to_product_database(), and test_connect_to_customer_database().
unsigned int get_customer_id_by_name | ( | DatabaseConnection *const | connection, |
const char *const | customer_name | ||
) |
Definition at line 35 of file customer_database.c.
References DatabaseConnection::query_database, and snprintf.
Referenced by test_get_customer_id_by_name().
int main | ( | void | ) |
Definition at line 83 of file customer_database_test.c.
References cmocka_run_group_tests, cmocka_unit_test, test_connect_to_customer_database(), and test_get_customer_id_by_name().
|
static |
Definition at line 27 of file customer_database_test.c.
References mock_ptr_type.
Referenced by test_get_customer_id_by_name().
|
static |
Definition at line 46 of file customer_database_test.c.
References assert_int_equal, assert_true, connect_to_customer_database(), connect_to_database(), and will_return.
Referenced by main().
|
static |
Definition at line 65 of file customer_database_test.c.
References assert_int_equal, cast_ptr_to_largest_integral_type, get_customer_id_by_name(), mock_query_database(), and will_return.
Referenced by main().