summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am6
-rw-r--r--tests/random.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 45a604f2..069285f5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -29,8 +29,7 @@ LDADD = $(top_builddir)/libdrm.la
check_PROGRAMS = \
dristat \
- drmstat \
- random
+ drmstat
if HAVE_NOUVEAU
SUBDIRS += nouveau
@@ -38,7 +37,8 @@ endif
TESTS = \
drmsl \
- hash
+ hash \
+ random
if HAVE_LIBUDEV
diff --git a/tests/random.c b/tests/random.c
index db341f9d..13d4c805 100644
--- a/tests/random.c
+++ b/tests/random.c
@@ -98,15 +98,17 @@ int main(void)
{
RandomState *state;
int i;
+ int ret;
unsigned long rand;
state = drmRandomCreate(1);
for (i = 0; i < 10000; i++) {
rand = drmRandom(state);
}
+ ret = rand != state->check;
printf("After 10000 iterations: %lu (%lu expected): %s\n",
rand, state->check,
- rand - state->check ? "*INCORRECT*" : "CORRECT");
+ ret ? "*INCORRECT*" : "CORRECT");
drmRandomDestroy(state);
printf("Checking periods...\n");
@@ -114,5 +116,5 @@ int main(void)
check_period(2);
check_period(31415926);
- return 0;
+ return ret;
}