File: testCfpNamespace.c

package info (click to toggle)
zfp 1.0.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,744 kB
  • sloc: cpp: 20,656; ansic: 18,871; pascal: 1,231; f90: 907; python: 255; makefile: 183; sh: 79; fortran: 70
file content (27 lines) | stat: -rw-r--r-- 640 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>

#include "zfp/array.h"

/* only run this test when compiling with CFP_NAMESPACE=cfp2 */

/* test fails if compiler errors out */
static void
given_cfpCompiledWithNamespace_cfp2_when_linkToCfpLib_expect_namespacePersists(void** state)
{
  cfp_array1d arr = cfp2.array1d.ctor_default();
  assert_non_null(arr.object);

  cfp2.array1d.dtor(arr);
}

int main()
{
  const struct CMUnitTest tests[] = {
    cmocka_unit_test(given_cfpCompiledWithNamespace_cfp2_when_linkToCfpLib_expect_namespacePersists),
  };

  return cmocka_run_group_tests(tests, NULL, NULL);
}