summaryrefslogtreecommitdiff
path: root/support/regression/tests/rand.c
blob: 43a706d63a8ba9cfa449046551a46f59e003a1cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* rand.c
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

#include <stdlib.h>

void testRand(void)
{
	/* The default seed is 1 */
	int r = rand();
	srand(1);
#ifndef __OpenBSD__ /* OpenBSD intentionally does not follow the C standard for rand() */
	ASSERT(r == rand());
#endif
}