Skip to content
Snippets Groups Projects
Commit 36b250c3 authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

Updated template and server unit tests.

parent 6ad605b3
Branches
Tags
No related merge requests found
#include "server/server.h"
#include "tap_unit.h"
int server_tests_count(int argc, char * argv[]);
int server_tests_run(int argc, char * argv[]);
static int server_tests_count(int argc, char * argv[]);
static int server_tests_run(int argc, char * argv[]);
/*
* Unit API.
......@@ -45,7 +45,7 @@ int test_server_destroy(cute_server* s)
}
/*! API: return number of tests. */
int server_tests_count(int argc, char * argv[])
static int server_tests_count(int argc, char * argv[])
{
return SERVER_TEST_COUNT + 1;
}
......@@ -56,7 +56,7 @@ static void interrupt_handle(int s)
}
/*! API: run tests. */
int server_tests_run(int argc, char * argv[])
static int server_tests_run(int argc, char * argv[])
{
cute_server* server = 0;
int ret = 0;
......
#include "tap_unit.h"
/* This is unit test template.
Implement two mandatory functions below,
name them accordingly and export unit API
via global variable of "unit_api".
Add the exported variable into the list
"unit_api* tests[]" in src/tests/main.c
There is no header file, all modules *.c files
are included directly into src/tests/main.c
*/
/* Unit implementation */
int TEMPLATE_tests_count(int argc, char *argv[])
/*! This helper routine should report number of
* scheduled tests for given parameters.
*/
static int TEMPLATE_tests_count(int argc, char *argv[])
{
return 1;
}
int TEMPLATE_tests_run(int argc, char *argv[])
/*! Run all scheduled tests for given parameters.
*/
static int TEMPLATE_tests_run(int argc, char *argv[])
{
ok(1 == 1, "dummy test");
return 0;
}
/* Exported unit API. */
/*! Exported unit API for later incorporation.
* Name must be unique for each module.
*/
unit_api TEMPLATE_tests_api = {
"TEMPLATE unit",
&TEMPLATE_tests_count,
&TEMPLATE_tests_run
"TEMPLATE unit", //! Unit name
&TEMPLATE_tests_count, //! Count scheduled tests
&TEMPLATE_tests_run //! Run scheduled tests
};
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment