mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 06:55:59 +03:00
Add test for loading the module.
This commit is contained in:
parent
96efd606b0
commit
22513d07f2
1 changed files with 52 additions and 0 deletions
52
tests/vio_tests/check_vio.c
Normal file
52
tests/vio_tests/check_vio.c
Normal file
|
@ -0,0 +1,52 @@
|
|||
#define _GNU_SOURCE /* asprintf */
|
||||
#include <string.h>
|
||||
|
||||
#include "support.h"
|
||||
|
||||
#include "csync_private.h"
|
||||
#include "vio/csync_vio.h"
|
||||
|
||||
CSYNC *csync;
|
||||
|
||||
static void setup(void) {
|
||||
csync_create(&csync);
|
||||
csync_init(csync);
|
||||
}
|
||||
|
||||
static void teardown(void) {
|
||||
csync_destroy(csync);
|
||||
}
|
||||
|
||||
START_TEST (check_csync_vio_load)
|
||||
{
|
||||
fail_unless(csync_vio_init(csync, "smb", NULL) == 0, NULL);
|
||||
|
||||
csync_vio_shutdown(csync);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
static Suite *csync_vio_suite(void) {
|
||||
Suite *s = suite_create("csync_vio");
|
||||
|
||||
create_case_fixture(s, "check_csync_vio_load", check_csync_vio_load, setup, teardown);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
int nf;
|
||||
|
||||
Suite *s = csync_vio_suite();
|
||||
|
||||
SRunner *sr;
|
||||
sr = srunner_create(s);
|
||||
#if 0
|
||||
srunner_set_fork_status(sr, CK_NOFORK);
|
||||
#endif
|
||||
srunner_run_all(sr, CK_VERBOSE);
|
||||
nf = srunner_ntests_failed(sr);
|
||||
srunner_free(sr);
|
||||
|
||||
return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
|
Loading…
Reference in a new issue