Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

  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
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
/*	$NetBSD: rpst.c,v 1.11 2011/04/26 20:53:34 yamt Exp $	*/

/*-
 * Copyright (c)2009 YAMAMOTO Takashi,
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

/*
 * radix priority search tree
 *
 * described in:
 *	SIAM J. COMPUT.
 *	Vol. 14, No. 2, May 1985
 *	PRIORITY SEARCH TREES
 *	EDWARD M. McCREIGHT
 *
 * ideas from linux:
 *	- grow tree height on-demand.
 *	- allow duplicated X values.  in that case, we act as a heap.
 */

#include <sys/cdefs.h>

#if defined(_KERNEL) || defined(_STANDALONE)
__KERNEL_RCSID(0, "$NetBSD: rpst.c,v 1.11 2011/04/26 20:53:34 yamt Exp $");
#include <sys/param.h>
#include <lib/libkern/libkern.h>
#if defined(_STANDALONE)
#include <lib/libsa/stand.h>
#endif /* defined(_STANDALONE) */
#else /* defined(_KERNEL) || defined(_STANDALONE) */
__RCSID("$NetBSD: rpst.c,v 1.11 2011/04/26 20:53:34 yamt Exp $");
#include <assert.h>
#include <stdbool.h>
#include <string.h>
#if 1
#define	KASSERT	assert
#else
#define	KASSERT(a)
#endif
#endif /* defined(_KERNEL) || defined(_STANDALONE) */

#include <sys/rpst.h>

/*
 * rpst_init_tree: initialize a tree.
 */

void
rpst_init_tree(struct rpst_tree *t)
{

	t->t_root = NULL;
	t->t_height = 0;
}

/*
 * rpst_height2max: calculate the maximum index which can be handled by
 * a tree with the given height.
 *
 * 0  ... 0x0000000000000001
 * 1  ... 0x0000000000000003
 * 2  ... 0x0000000000000007
 * 3  ... 0x000000000000000f
 *
 * 31 ... 0x00000000ffffffff
 *
 * 63 ... 0xffffffffffffffff
 */

static uint64_t
rpst_height2max(unsigned int height)
{

	KASSERT(height < 64);
	if (height == 63) {
		return UINT64_MAX;
	}
	return (UINT64_C(1) << (height + 1)) - 1;
}

/*
 * rpst_level2mask: calculate the mask for the given level in the tree.
 *
 * the mask used to index root's children is level 0.
 */

static uint64_t
rpst_level2mask(const struct rpst_tree *t, unsigned int level)
{
	uint64_t mask;

	if (t->t_height < level) {
		mask = 0;
	} else {
		mask = UINT64_C(1) << (t->t_height - level);
	}
	return mask;
}

/*
 * rpst_startmask: calculate the mask for the start of a search.
 * (ie. the mask for the top-most bit)
 */

static uint64_t
rpst_startmask(const struct rpst_tree *t)
{
	const uint64_t mask = rpst_level2mask(t, 0);

	KASSERT((mask | (mask - 1)) == rpst_height2max(t->t_height));
	return mask;
}

/*
 * rpst_update_parents: update n_parent of children
 */

static inline void
rpst_update_parents(struct rpst_node *n)
{
	int i;

	for (i = 0; i < 2; i++) {
		if (n->n_children[i] != NULL) {
			n->n_children[i]->n_parent = n;
		}
	}
}

/*
 * rpst_enlarge_tree: enlarge tree so that 'idx' can be stored
 */

static void
rpst_enlarge_tree(struct rpst_tree *t, uint64_t idx)
{

	while (idx > rpst_height2max(t->t_height)) {
		struct rpst_node *n = t->t_root;

		if (n != NULL) {
			rpst_remove_node(t, n);
			memset(&n->n_children, 0, sizeof(n->n_children));
			n->n_children[0] = t->t_root;
			t->t_root->n_parent = n;
			t->t_root = n;
			n->n_parent = NULL;
		}
		t->t_height++;
	}
}

/*
 * rpst_insert_node1: a helper for rpst_insert_node.
 */

static struct rpst_node *
rpst_insert_node1(struct rpst_node **where, struct rpst_node *n, uint64_t mask)
{
	struct rpst_node *parent;
	struct rpst_node *cur;
	unsigned int idx;

	KASSERT((n->n_x & ((-mask) << 1)) == 0);
	parent = NULL;
next:
	cur = *where;
	if (cur == NULL) {
		n->n_parent = parent;
		memset(&n->n_children, 0, sizeof(n->n_children));
		*where = n;
		return NULL;
	}
	KASSERT(cur->n_parent == parent);
	if (n->n_y == cur->n_y && n->n_x == cur->n_x) {
		return cur;
	}
	if (n->n_y < cur->n_y) {
		/*
		 * swap cur and n.
		 * note that n is not in tree.
		 */
		memcpy(n->n_children, cur->n_children, sizeof(n->n_children));
		n->n_parent = cur->n_parent;
		rpst_update_parents(n);
		*where = n;
		n = cur;
		cur = *where;
	}
	KASSERT(*where == cur);
	idx = (n->n_x & mask) != 0;
	where = &cur->n_children[idx];
	parent = cur;
	KASSERT((*where) == NULL || ((((*where)->n_x & mask) != 0) == idx));
	KASSERT((*where) == NULL || (*where)->n_y >= cur->n_y);
	mask >>= 1;
	goto next;
}

/*
 * rpst_insert_node: insert a node into the tree.
 *
 * => return NULL on success.
 * => if a duplicated node (a node with the same X,Y pair as ours) is found,
 *    return the node.  in that case, the tree is intact.
 */

struct rpst_node *
rpst_insert_node(struct rpst_tree *t, struct rpst_node *n)
{

	rpst_enlarge_tree(t, n->n_x);
	return rpst_insert_node1(&t->t_root, n, rpst_startmask(t));
}

/*
 * rpst_find_pptr: find a pointer to the given node.
 *
 * also, return the parent node via parentp.  (NULL for the root node.)
 */

static inline struct rpst_node **
rpst_find_pptr(struct rpst_tree *t, struct rpst_node *n,
    struct rpst_node **parentp)
{
	struct rpst_node * const parent = n->n_parent;
	unsigned int i;

	*parentp = parent;
	if (parent == NULL) {
		return &t->t_root;
	}
	for (i = 0; i < 2 - 1; i++) {
		if (parent->n_children[i] == n) {
			break;
		}
	}
	KASSERT(parent->n_children[i] == n);
	return &parent->n_children[i];
}

/*
 * rpst_remove_node_at: remove a node at *where.
 */

static void
rpst_remove_node_at(struct rpst_node *parent, struct rpst_node **where,
    struct rpst_node *cur)
{
	struct rpst_node *tmp[2];
	struct rpst_node *selected;
	unsigned int selected_idx = 0; /* XXX gcc */
	unsigned int i;

	KASSERT(cur != NULL);
	KASSERT(parent == cur->n_parent);
next:
	selected = NULL;
	for (i = 0; i < 2; i++) {
		struct rpst_node *c;

		c = cur->n_children[i];
		KASSERT(c == NULL || c->n_parent == cur);
		if (selected == NULL || (c != NULL && c->n_y < selected->n_y)) {
			selected = c;
			selected_idx = i;
		}
	}
	/*
	 * now we have:
	 *
	 *      parent
	 *          \ <- where
	 *           cur
	 *           / \
	 *          A  selected
	 *              / \
	 *             B   C
	 */
	*where = selected;
	if (selected == NULL) {
		return;
	}
	/*
	 * swap selected->n_children and cur->n_children.
	 */
	memcpy(tmp, selected->n_children, sizeof(tmp));
	memcpy(selected->n_children, cur->n_children, sizeof(tmp));
	memcpy(cur->n_children, tmp, sizeof(tmp));
	rpst_update_parents(cur);
	rpst_update_parents(selected);
	selected->n_parent = parent;
	/*
	 *      parent
	 *          \ <- where
	 *          selected
	 *           / \
	 *          A  selected
	 *
	 *              cur
	 *              / \
	 *             B   C
	 */
	where = &selected->n_children[selected_idx];
	/*
	 *      parent
	 *          \
	 *          selected
	 *           / \ <- where
	 *          A  selected (*)
	 *
	 *              cur (**)
	 *              / \
	 *             B   C
	 *
	 * (*) this 'selected' will be overwritten in the next iteration.
	 * (**) cur->n_parent is bogus.
	 */
	parent = selected;
	goto next;
}

/*
 * rpst_remove_node: remove a node from the tree.
 */

void
rpst_remove_node(struct rpst_tree *t, struct rpst_node *n)
{
	struct rpst_node *parent;
	struct rpst_node **where;

	where = rpst_find_pptr(t, n, &parent);
	rpst_remove_node_at(parent, where, n);
}

static bool __unused
rpst_iterator_match_p(const struct rpst_node *n, const struct rpst_iterator *it)
{

	if (n->n_y > it->it_max_y) {
		return false;
	}
	if (n->n_x < it->it_min_x) {
		return false;
	}
	if (n->n_x > it->it_max_x) {
		return false;
	}
	return true;
}

struct rpst_node *
rpst_iterate_first(struct rpst_tree *t, uint64_t max_y, uint64_t min_x,
    uint64_t max_x, struct rpst_iterator *it)
{
	struct rpst_node *n;

	KASSERT(min_x <= max_x);
	n = t->t_root;
	if (n == NULL || n->n_y > max_y) {
		return NULL;
	}
	if (rpst_height2max(t->t_height) < min_x) {
		return NULL;
	}
	it->it_tree = t;
	it->it_cur = n;
	it->it_idx = (min_x & rpst_startmask(t)) != 0;
	it->it_level = 0;
	it->it_max_y = max_y;
	it->it_min_x = min_x;
	it->it_max_x = max_x;
	return rpst_iterate_next(it);
}

static inline unsigned int
rpst_node_on_edge_p(const struct rpst_node *n, uint64_t val, uint64_t mask)
{

	return ((n->n_x ^ val) & ((-mask) << 1)) == 0;
}

static inline uint64_t
rpst_maxidx(const struct rpst_node *n, uint64_t max_x, uint64_t mask)
{

	if (rpst_node_on_edge_p(n, max_x, mask)) {
		return (max_x & mask) != 0;
	} else {
		return 1;
	}
}

static inline uint64_t
rpst_minidx(const struct rpst_node *n, uint64_t min_x, uint64_t mask)
{

	if (rpst_node_on_edge_p(n, min_x, mask)) {
		return (min_x & mask) != 0;
	} else {
		return 0;
	}
}

struct rpst_node *
rpst_iterate_next(struct rpst_iterator *it)
{
	struct rpst_tree *t;
	struct rpst_node *n;
	struct rpst_node *next;
	const uint64_t max_y = it->it_max_y;
	const uint64_t min_x = it->it_min_x;
	const uint64_t max_x = it->it_max_x;
	unsigned int idx;
	unsigned int maxidx;
	unsigned int level;
	uint64_t mask;

	t = it->it_tree;
	n = it->it_cur;
	idx = it->it_idx;
	level = it->it_level;
	mask = rpst_level2mask(t, level);
	maxidx = rpst_maxidx(n, max_x, mask);
	KASSERT(n == t->t_root || rpst_iterator_match_p(n, it));
next:
	KASSERT(mask == rpst_level2mask(t, level));
	KASSERT(idx >= rpst_minidx(n, min_x, mask));
	KASSERT(maxidx == rpst_maxidx(n, max_x, mask));
	KASSERT(idx <= maxidx + 2);
	KASSERT(n != NULL);
#if 0
	printf("%s: cur=%p, idx=%u maxidx=%u level=%u mask=%" PRIx64 "\n",
	    __func__, (void *)n, idx, maxidx, level, mask);
#endif
	if (idx == maxidx + 1) { /* visit the current node */
		idx++;
		if (min_x <= n->n_x && n->n_x <= max_x) {
			it->it_cur = n;
			it->it_idx = idx;
			it->it_level = level;
			KASSERT(rpst_iterator_match_p(n, it));
			return n; /* report */
		}
		goto next;
	} else if (idx == maxidx + 2) { /* back to the parent */
		struct rpst_node **where;

		where = rpst_find_pptr(t, n, &next);
		if (next == NULL) {
			KASSERT(level == 0);
			KASSERT(t->t_root == n);
			KASSERT(&t->t_root == where);
			return NULL; /* done */
		}
		KASSERT(level > 0);
		level--;
		n = next;
		mask = rpst_level2mask(t, level);
		maxidx = rpst_maxidx(n, max_x, mask);
		idx = where - n->n_children + 1;
		KASSERT(idx < 2 + 1);
		goto next;
	}
	/* go to a child */
	KASSERT(idx < 2);
	next = n->n_children[idx];
	if (next == NULL || next->n_y > max_y) {
		idx++;
		goto next;
	}
	KASSERT(next->n_parent == n);
	KASSERT(next->n_y >= n->n_y);
	level++;
	mask >>= 1;
	n = next;
	idx = rpst_minidx(n, min_x, mask);
	maxidx = rpst_maxidx(n, max_x, mask);
#if 0
	printf("%s: visit %p idx=%u level=%u mask=%llx\n",
	    __func__, n, idx, level, mask);
#endif
	goto next;
}

#if defined(UNITTEST)
#include <sys/time.h>

#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>

static void
rpst_dump_node(const struct rpst_node *n, unsigned int depth)
{
	unsigned int i;

	for (i = 0; i < depth; i++) {
		printf("  ");
	}
	printf("[%u]", depth);
	if (n == NULL) {
		printf("NULL\n");
		return;
	}
	printf("%p x=%" PRIx64 "(%" PRIu64 ") y=%" PRIx64 "(%" PRIu64 ")\n",
	    (const void *)n, n->n_x, n->n_x, n->n_y, n->n_y);
	for (i = 0; i < 2; i++) {
		rpst_dump_node(n->n_children[i], depth + 1);
	}
}

static void
rpst_dump_tree(const struct rpst_tree *t)
{

	printf("pst %p height=%u\n", (const void *)t, t->t_height);
	rpst_dump_node(t->t_root, 0);
}

struct testnode {
	struct rpst_node n;
	struct testnode *next;
	bool failed;
	bool found;
};

struct rpst_tree t;
struct testnode *h = NULL;

static uintmax_t
tvdiff(const struct timeval *tv1, const struct timeval *tv2)
{

	return (uintmax_t)tv1->tv_sec * 1000000 + tv1->tv_usec -
	    tv2->tv_sec * 1000000 - tv2->tv_usec;
}

static unsigned int
query(uint64_t max_y, uint64_t min_x, uint64_t max_x)
{
	struct testnode *n;
	struct rpst_node *rn;
	struct rpst_iterator it;
	struct timeval start;
	struct timeval end;
	unsigned int done;

	printf("quering max_y=%" PRIu64 " min_x=%" PRIu64 " max_x=%" PRIu64
	    "\n",
	    max_y, min_x, max_x);
	done = 0;
	gettimeofday(&start, NULL);
	for (rn = rpst_iterate_first(&t, max_y, min_x, max_x, &it);
	    rn != NULL;
	    rn = rpst_iterate_next(&it)) {
		done++;
#if 0
		printf("found %p x=%" PRIu64 " y=%" PRIu64 "\n",
		    (void *)rn, rn->n_x, rn->n_y);
#endif
		n = (void *)rn;
		assert(!n->found);
		n->found = true;
	}
	gettimeofday(&end, NULL);
	printf("%u nodes found in %ju usecs\n", done,
	    tvdiff(&end, &start));

	gettimeofday(&start, NULL);
	for (n = h; n != NULL; n = n->next) {
		assert(n->failed ||
		    n->found == rpst_iterator_match_p(&n->n, &it));
		n->found = false;
	}
	gettimeofday(&end, NULL);
	printf("(linear search took %ju usecs)\n", tvdiff(&end, &start));
	return done;
}

int
main(int argc, char *argv[])
{
	struct testnode *n;
	unsigned int i;
	struct rpst_iterator it;
	struct timeval start;
	struct timeval end;
	uint64_t min_y = UINT64_MAX;
	uint64_t max_y = 0;
	uint64_t min_x = UINT64_MAX;
	uint64_t max_x = 0;
	uint64_t w;
	unsigned int done;
	unsigned int fail;
	unsigned int num = 500000;

	rpst_init_tree(&t);
	rpst_dump_tree(&t);
	assert(NULL == rpst_iterate_first(&t, UINT64_MAX, 0, UINT64_MAX, &it));

	for (i = 0; i < num; i++) {
		n = malloc(sizeof(*n));
		if (i > 499000) {
			n->n.n_x = 10;
			n->n.n_y = random();
		} else if (i > 400000) {
			n->n.n_x = i;
			n->n.n_y = random();
		} else {
			n->n.n_x = random();
			n->n.n_y = random();
		}
		if (n->n.n_y < min_y) {
			min_y = n->n.n_y;
		}
		if (n->n.n_y > max_y) {
			max_y = n->n.n_y;
		}
		if (n->n.n_x < min_x) {
			min_x = n->n.n_x;
		}
		if (n->n.n_x > max_x) {
			max_x = n->n.n_x;
		}
		n->found = false;
		n->failed = false;
		n->next = h;
		h = n;
	}

	done = 0;
	fail = 0;
	gettimeofday(&start, NULL);
	for (n = h; n != NULL; n = n->next) {
		struct rpst_node *o;
#if 0
		printf("insert %p x=%" PRIu64 " y=%" PRIu64 "\n",
		    n, n->n.n_x, n->n.n_y);
#endif
		o = rpst_insert_node(&t, &n->n);
		if (o == NULL) {
			done++;
		} else {
			n->failed = true;
			fail++;
		}
	}
	gettimeofday(&end, NULL);
	printf("%u nodes inserted and %u insertion failed in %ju usecs\n",
	    done, fail,
	    tvdiff(&end, &start));

	assert(min_y == 0 || 0 == query(min_y - 1, 0, UINT64_MAX));
	assert(max_x == UINT64_MAX ||
	    0 == query(UINT64_MAX, max_x + 1, UINT64_MAX));
	assert(min_x == 0 || 0 == query(UINT64_MAX, 0, min_x - 1));

	done = query(max_y, min_x, max_x);
	assert(done == num - fail);

	done = query(UINT64_MAX, 0, UINT64_MAX);
	assert(done == num - fail);

	w = max_x - min_x;
	query(max_y / 2, min_x, max_x);
	query(max_y, min_x + w / 2, max_x);
	query(max_y / 2, min_x + w / 2, max_x);
	query(max_y / 2, min_x, max_x - w / 2);
	query(max_y / 2, min_x + w / 3, max_x - w / 3);
	query(max_y - 1, min_x + 1, max_x - 1);
	query(UINT64_MAX, 10, 10);

	done = 0;
	gettimeofday(&start, NULL);
	for (n = h; n != NULL; n = n->next) {
		if (n->failed) {
			continue;
		}
#if 0
		printf("remove %p x=%" PRIu64 " y=%" PRIu64 "\n",
		    n, n->n.n_x, n->n.n_y);
#endif
		rpst_remove_node(&t, &n->n);
		done++;
	}
	gettimeofday(&end, NULL);
	printf("%u nodes removed in %ju usecs\n", done,
	    tvdiff(&end, &start));

	rpst_dump_tree(&t);
}
#endif /* defined(UNITTEST) */