File: test-lib.c

package info (click to toggle)
pipewire 1.4.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,892 kB
  • sloc: ansic: 296,152; cpp: 2,815; xml: 407; python: 234; sh: 211; makefile: 168; pascal: 85
file content (48 lines) | stat: -rw-r--r-- 906 bytes parent folder | download | duplicates (5)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* PipeWire */
/* SPDX-FileCopyrightText: Copyright © 2021 Red Hat, Inc. */
/* SPDX-License-Identifier: MIT */

#include "config.h"

#include "pwtest.h"

#include "pipewire/pipewire.h"

PWTEST(library_version)
{
	const char *libversion, *headerversion;
	char version_expected[64];

	pw_init(0, NULL);
	libversion = pw_get_library_version();
	headerversion = pw_get_headers_version();

	spa_scnprintf(version_expected, sizeof(version_expected),
		"%d.%d.%d", PW_MAJOR, PW_MINOR, PW_MICRO);

	pwtest_str_eq(headerversion, version_expected);
	pwtest_str_eq(libversion, version_expected);

	pw_deinit();

	return PWTEST_PASS;
}

PWTEST(init_deinit)
{
	pw_init(0, NULL);
	pw_deinit();
	pw_init(0, NULL);
	pw_init(0, NULL);
	pw_deinit();
	pw_deinit();
	return PWTEST_PASS;
}

PWTEST_SUITE(properties)
{
	pwtest_add(library_version, PWTEST_NOARG);
	pwtest_add(init_deinit, PWTEST_NOARG);

	return PWTEST_PASS;
}