Renamed RandomInteger to RandomSint32 and RandomUnsignedInteger
authorMarkus Kauppila <markus.kauppila@gmail.com>
Wed, 17 Aug 2011 11:44:57 +0300
changeset 5838 8b9d6ec8150a
parent 5837 b17d82db0905
child 5839 98eed46feb99
Renamed RandomInteger to RandomSint32 and RandomUnsignedInteger to RandomUint32.
test/test-automation/src/libSDLtest/fuzzer/fuzzer.c
test/test-automation/src/libSDLtest/fuzzer/fuzzer.h
test/test-automation/tests/testdummy/testdummy.c
--- a/test/test-automation/src/libSDLtest/fuzzer/fuzzer.c	Wed Aug 17 10:34:42 2011 +0300
+++ b/test/test-automation/src/libSDLtest/fuzzer/fuzzer.c	Wed Aug 17 11:44:57 2011 +0300
@@ -130,13 +130,13 @@
 }
 
 Sint32
-RandomInteger()
+RandomSint32()
 {
 	return (Sint32) utl_randomInt(&rndContext);
 }
 
 Uint32
-RandomPositiveInteger()
+RandomUint32()
 {
 	return (Uint32) utl_randomInt(&rndContext);
 }
@@ -147,8 +147,8 @@
 	Uint64 value;
 
 	Uint32 *vp = (Uint32*)&value;
-	vp[0] = RandomInteger();
-	vp[1] = RandomInteger();
+	vp[0] = RandomSint32();
+	vp[1] = RandomSint32();
 
 	return value;
 }
@@ -159,8 +159,8 @@
 	Uint64 value;
 
 	Uint32 *vp = (Uint32*)&value;
-	vp[0] = RandomInteger();
-	vp[1] = RandomInteger();
+	vp[0] = RandomSint32();
+	vp[1] = RandomSint32();
 
 	return value;
 }
@@ -180,7 +180,7 @@
 		return min;
 	}
 
-	Sint32 number = abs(utl_randomInt(&rndContext));
+	Sint32 number = RandomSint32();
 
 	return (number % ((max + 1) - min)) + min;
 }
@@ -287,7 +287,7 @@
 		return 0;
 	}
 
-	Uint32 index = RandomInteger() % size;
+	Uint32 index = RandomSint32() % size;
 	Uint8 retVal = (Uint8) buffer[index];
 
 	SDL_free(buffer);
@@ -311,7 +311,7 @@
 		return 0;
 	}
 
-	Uint32 index = RandomInteger() % size;
+	Uint32 index = RandomSint32() % size;
 	Uint16 retVal = (Uint16) buffer[index];
 
 	SDL_free(buffer);
@@ -335,7 +335,7 @@
 		return 0;
 	}
 
-	Uint32 index = RandomInteger() % size;
+	Uint32 index = RandomSint32() % size;
 	Uint32 retVal = (Uint32) buffer[index];
 
 	SDL_free(buffer);
@@ -359,7 +359,7 @@
 		return 0;
 	}
 
-	Uint32 index = RandomInteger() % size;
+	Uint32 index = RandomSint32() % size;
 	Uint64 retVal = (Uint64) buffer[index];
 
 	SDL_free(buffer);
@@ -476,7 +476,7 @@
 		return CHAR_MIN;
 	}
 
-	Uint32 index = RandomInteger() % size;
+	Uint32 index = RandomSint32() % size;
 	Sint8 retVal = (Sint8) buffer[index];
 
 	SDL_free(buffer);
@@ -501,7 +501,7 @@
 		return SHRT_MIN;
 	}
 
-	Uint32 index = RandomInteger() % size;
+	Uint32 index = RandomSint32() % size;
 	Sint16 retVal = (Sint16) buffer[index];
 
 	SDL_free(buffer);
@@ -526,7 +526,7 @@
 		return INT_MIN;
 	}
 
-	Uint32 index = RandomInteger() % size;
+	Uint32 index = RandomSint32() % size;
 	Sint32 retVal = (Sint32) buffer[index];
 
 	SDL_free(buffer);
@@ -551,7 +551,7 @@
 		return LLONG_MIN;
 	}
 
-	Uint32 index = RandomInteger() % size;
+	Uint32 index = RandomSint32() % size;
 	Sint64 retVal = (Sint64) buffer[index];
 
 	SDL_free(buffer);
@@ -599,7 +599,7 @@
 		return NULL;
 	}
 
-	int size = (abs(RandomInteger()) % (maxSize + 1)) + 1;
+	int size = (abs(RandomSint32()) % (maxSize + 1)) + 1;
 	char *string = SDL_malloc(size * sizeof(char));
 
 	int counter = 0;
--- a/test/test-automation/src/libSDLtest/fuzzer/fuzzer.h	Wed Aug 17 10:34:42 2011 +0300
+++ b/test/test-automation/src/libSDLtest/fuzzer/fuzzer.h	Wed Aug 17 11:44:57 2011 +0300
@@ -80,7 +80,7 @@
  *
  * \returns Generated integer
  */
-Sint32 RandomInteger();
+Sint32 RandomSint32();
 
 
 /*!
@@ -88,7 +88,7 @@
  *
  * \returns Generated integer
  */
-Uint32 RandomPositiveInteger();
+Uint32 RandomUint32();
 
 /*!
  * Returns random Uint64.
--- a/test/test-automation/tests/testdummy/testdummy.c	Wed Aug 17 10:34:42 2011 +0300
+++ b/test/test-automation/tests/testdummy/testdummy.c	Wed Aug 17 11:44:57 2011 +0300
@@ -98,7 +98,7 @@
 
 	/*
 	for( ; 1 ; )
-		Log(0, "uint8 (same value): %u", RandomPositiveInteger());
+		Log(0, "uint8 (same value): %u", RandomUint32());
 	// */
 
 	//Log(0, "uint8 (same value): %d", RandomUint8BoundaryValue(200, 200, SDL_TRUE));