X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Ftest-util.c;h=5afe2f7c5deb9f30d0647e802b7183abe776024c;hb=b028db44ca684fbd5361001dc3ed543a37374fbb;hp=3422af3a2776587b87016090e7bdca6d3f3e10d4;hpb=61d71ceb5d45e6caeaf08a63efeba931a10b32f3;p=sliver-openvswitch.git diff --git a/tests/test-util.c b/tests/test-util.c index 3422af3a2..5afe2f7c5 100644 --- a/tests/test-util.c +++ b/tests/test-util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012 Nicira, Inc. + * Copyright (c) 2011, 2012, 2013 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,7 +94,7 @@ static void shuffle(unsigned int *p, size_t n) { for (; n > 1; n--, p++) { - unsigned int *q = &p[rand() % n]; + unsigned int *q = &p[random_range(n)]; unsigned int tmp = *p; *p = *q; *q = tmp; @@ -297,7 +297,7 @@ test_bitwise_is_all_zeros(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) /* Change a random 0-bit into a 1-bit. */ do { - bit = htonll(UINT64_C(1) << (random_uint32() % 64)); + bit = htonll(UINT64_C(1) << (random_range(64))); } while (x & bit); x |= bit;