コード例 #1
0
void t_network_injection_queue_new() {
	network_injection_queue *q;

	q = network_injection_queue_new();
	g_assert(q);

	network_injection_queue_free(q);
}
コード例 #2
0
void t_network_injection_queue_prepend() {
	network_injection_queue *q;

	q = network_injection_queue_new();
	g_assert(q);

	g_assert_cmpint(0, ==, network_injection_queue_len(q));
	network_injection_queue_prepend(q, injection_new(1, NULL));
	g_assert_cmpint(1, ==, network_injection_queue_len(q));
	network_injection_queue_prepend(q, injection_new(1, NULL));
	g_assert_cmpint(2, ==, network_injection_queue_len(q));

	network_injection_queue_free(q);
}
コード例 #3
0
/**
 * reseting a used and empty queue 
 */
void t_network_injection_queue_reset() {
	network_injection_queue *q;

	q = network_injection_queue_new();
	g_assert(q);

	/* add something to the queue and check if resetting works */
	g_assert_cmpint(0, ==, network_injection_queue_len(q));
	network_injection_queue_append(q, injection_new(1, NULL));
	g_assert_cmpint(1, ==, network_injection_queue_len(q));
	network_injection_queue_reset(q);
	g_assert_cmpint(0, ==, network_injection_queue_len(q));

	/* reset a empty queue */
	network_injection_queue_reset(q);
	g_assert_cmpint(0, ==, network_injection_queue_len(q));

	network_injection_queue_reset(q);
	g_assert_cmpint(0, ==, network_injection_queue_len(q));

	network_injection_queue_free(q);
}
コード例 #4
0
network_mysqld_con_python_t *network_mysqld_con_python_new() {
	network_mysqld_con_python_t *st;
	st = g_new0(network_mysqld_con_python_t, 1);
	st->injected.queries = network_injection_queue_new();
	return st;
}