File: test_memory.tcc

package info (click to toggle)
uhub 0.4.1-3.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 1,436 kB
  • ctags: 2,270
  • sloc: ansic: 18,123; xml: 575; perl: 568; sh: 368; makefile: 24
file content (37 lines) | stat: -rw-r--r-- 661 bytes parent folder | download | duplicates (4)
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
#include <uhub.h>

struct adc_message* g_msg;

EXO_TEST(test_message_refc_1, {
	g_msg = adc_msg_create("IMSG Hello\\sWorld!");
	return g_msg != NULL;
});

EXO_TEST(test_message_refc_2, {
	return g_msg->references == 1;
});

EXO_TEST(test_message_refc_3, {
	adc_msg_incref(g_msg);
	return g_msg->references == 2;
});

EXO_TEST(test_message_refc_4, {
	adc_msg_incref(g_msg);
	return g_msg->references == 3;
});

EXO_TEST(test_message_refc_5, {
	adc_msg_free(g_msg);
	return g_msg->references == 2;
});

EXO_TEST(test_message_refc_6, {
	adc_msg_free(g_msg);
	return g_msg->references == 1;
});

EXO_TEST(test_message_refc_7, {
	adc_msg_free(g_msg);
	return 1;
});