test_session.c 718 Bytes
Newer Older
Moritz Lipp's avatar
Moritz Lipp committed
1 2 3 4
/* See LICENSE file for license and copyright information */

#include <check.h>

Moritz Lipp's avatar
Moritz Lipp committed
5
#include "zathura.h"
6
#include "tests.h"
Moritz Lipp's avatar
Moritz Lipp committed
7 8

START_TEST(test_create) {
9
  zathura_t* zathura = zathura_create();
Sebastian Ramacher's avatar
Sebastian Ramacher committed
10
  fail_unless(zathura != NULL, "Could not create session", NULL);
11
  fail_unless(zathura_init(zathura) == true, "Could not initialize session", NULL);
Moritz Lipp's avatar
Moritz Lipp committed
12 13 14
  zathura_free(zathura);
} END_TEST

15
static Suite* suite_session(void)
Moritz Lipp's avatar
Moritz Lipp committed
16 17 18 19 20 21
{
  TCase* tcase = NULL;
  Suite* suite = suite_create("Session");

  /* basic */
  tcase = tcase_create("basic");
22
  tcase_add_checked_fixture(tcase, setup, NULL);
Moritz Lipp's avatar
Moritz Lipp committed
23 24 25 26 27
  tcase_add_test(tcase, test_create);
  suite_add_tcase(suite, tcase);

  return suite;
}
28 29 30 31 32

int main()
{
  return run_suite(suite_session());
}