SDL standard library

Dependents:   H261_encoder

Committer:
miruga27
Date:
Wed Sep 07 18:46:53 2016 +0000
Revision:
0:dda4f4550403
7/09/2016;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
miruga27 0:dda4f4550403 1 /*
miruga27 0:dda4f4550403 2 Simple DirectMedia Layer
miruga27 0:dda4f4550403 3 Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
miruga27 0:dda4f4550403 4
miruga27 0:dda4f4550403 5 This software is provided 'as-is', without any express or implied
miruga27 0:dda4f4550403 6 warranty. In no event will the authors be held liable for any damages
miruga27 0:dda4f4550403 7 arising from the use of this software.
miruga27 0:dda4f4550403 8
miruga27 0:dda4f4550403 9 Permission is granted to anyone to use this software for any purpose,
miruga27 0:dda4f4550403 10 including commercial applications, and to alter it and redistribute it
miruga27 0:dda4f4550403 11 freely, subject to the following restrictions:
miruga27 0:dda4f4550403 12
miruga27 0:dda4f4550403 13 1. The origin of this software must not be misrepresented; you must not
miruga27 0:dda4f4550403 14 claim that you wrote the original software. If you use this software
miruga27 0:dda4f4550403 15 in a product, an acknowledgment in the product documentation would be
miruga27 0:dda4f4550403 16 appreciated but is not required.
miruga27 0:dda4f4550403 17 2. Altered source versions must be plainly marked as such, and must not be
miruga27 0:dda4f4550403 18 misrepresented as being the original software.
miruga27 0:dda4f4550403 19 3. This notice may not be removed or altered from any source distribution.
miruga27 0:dda4f4550403 20 */
miruga27 0:dda4f4550403 21
miruga27 0:dda4f4550403 22 /**
miruga27 0:dda4f4550403 23 * \file SDL_test_fuzzer.h
miruga27 0:dda4f4550403 24 *
miruga27 0:dda4f4550403 25 * Include file for SDL test framework.
miruga27 0:dda4f4550403 26 *
miruga27 0:dda4f4550403 27 * This code is a part of the SDL2_test library, not the main SDL library.
miruga27 0:dda4f4550403 28 */
miruga27 0:dda4f4550403 29
miruga27 0:dda4f4550403 30 /*
miruga27 0:dda4f4550403 31
miruga27 0:dda4f4550403 32 Data generators for fuzzing test data in a reproducible way.
miruga27 0:dda4f4550403 33
miruga27 0:dda4f4550403 34 */
miruga27 0:dda4f4550403 35
miruga27 0:dda4f4550403 36 #ifndef _SDL_test_fuzzer_h
miruga27 0:dda4f4550403 37 #define _SDL_test_fuzzer_h
miruga27 0:dda4f4550403 38
miruga27 0:dda4f4550403 39 #include "begin_code.h"
miruga27 0:dda4f4550403 40 /* Set up for C function definitions, even when using C++ */
miruga27 0:dda4f4550403 41 #ifdef __cplusplus
miruga27 0:dda4f4550403 42 extern "C" {
miruga27 0:dda4f4550403 43 #endif
miruga27 0:dda4f4550403 44
miruga27 0:dda4f4550403 45
miruga27 0:dda4f4550403 46 /*
miruga27 0:dda4f4550403 47 Based on GSOC code by Markus Kauppila <markus.kauppila@gmail.com>
miruga27 0:dda4f4550403 48 */
miruga27 0:dda4f4550403 49
miruga27 0:dda4f4550403 50
miruga27 0:dda4f4550403 51 /**
miruga27 0:dda4f4550403 52 * \file
miruga27 0:dda4f4550403 53 * Note: The fuzzer implementation uses a static instance of random context
miruga27 0:dda4f4550403 54 * internally which makes it thread-UNsafe.
miruga27 0:dda4f4550403 55 */
miruga27 0:dda4f4550403 56
miruga27 0:dda4f4550403 57 /**
miruga27 0:dda4f4550403 58 * Initializes the fuzzer for a test
miruga27 0:dda4f4550403 59 *
miruga27 0:dda4f4550403 60 * /param execKey Execution "Key" that initializes the random number generator uniquely for the test.
miruga27 0:dda4f4550403 61 *
miruga27 0:dda4f4550403 62 */
miruga27 0:dda4f4550403 63 void SDLTest_FuzzerInit(Uint64 execKey);
miruga27 0:dda4f4550403 64
miruga27 0:dda4f4550403 65
miruga27 0:dda4f4550403 66 /**
miruga27 0:dda4f4550403 67 * Returns a random Uint8
miruga27 0:dda4f4550403 68 *
miruga27 0:dda4f4550403 69 * \returns Generated integer
miruga27 0:dda4f4550403 70 */
miruga27 0:dda4f4550403 71 Uint8 SDLTest_RandomUint8();
miruga27 0:dda4f4550403 72
miruga27 0:dda4f4550403 73 /**
miruga27 0:dda4f4550403 74 * Returns a random Sint8
miruga27 0:dda4f4550403 75 *
miruga27 0:dda4f4550403 76 * \returns Generated signed integer
miruga27 0:dda4f4550403 77 */
miruga27 0:dda4f4550403 78 Sint8 SDLTest_RandomSint8();
miruga27 0:dda4f4550403 79
miruga27 0:dda4f4550403 80
miruga27 0:dda4f4550403 81 /**
miruga27 0:dda4f4550403 82 * Returns a random Uint16
miruga27 0:dda4f4550403 83 *
miruga27 0:dda4f4550403 84 * \returns Generated integer
miruga27 0:dda4f4550403 85 */
miruga27 0:dda4f4550403 86 Uint16 SDLTest_RandomUint16();
miruga27 0:dda4f4550403 87
miruga27 0:dda4f4550403 88 /**
miruga27 0:dda4f4550403 89 * Returns a random Sint16
miruga27 0:dda4f4550403 90 *
miruga27 0:dda4f4550403 91 * \returns Generated signed integer
miruga27 0:dda4f4550403 92 */
miruga27 0:dda4f4550403 93 Sint16 SDLTest_RandomSint16();
miruga27 0:dda4f4550403 94
miruga27 0:dda4f4550403 95
miruga27 0:dda4f4550403 96 /**
miruga27 0:dda4f4550403 97 * Returns a random integer
miruga27 0:dda4f4550403 98 *
miruga27 0:dda4f4550403 99 * \returns Generated integer
miruga27 0:dda4f4550403 100 */
miruga27 0:dda4f4550403 101 Sint32 SDLTest_RandomSint32();
miruga27 0:dda4f4550403 102
miruga27 0:dda4f4550403 103
miruga27 0:dda4f4550403 104 /**
miruga27 0:dda4f4550403 105 * Returns a random positive integer
miruga27 0:dda4f4550403 106 *
miruga27 0:dda4f4550403 107 * \returns Generated integer
miruga27 0:dda4f4550403 108 */
miruga27 0:dda4f4550403 109 Uint32 SDLTest_RandomUint32();
miruga27 0:dda4f4550403 110
miruga27 0:dda4f4550403 111 /**
miruga27 0:dda4f4550403 112 * Returns random Uint64.
miruga27 0:dda4f4550403 113 *
miruga27 0:dda4f4550403 114 * \returns Generated integer
miruga27 0:dda4f4550403 115 */
miruga27 0:dda4f4550403 116 Uint64 SDLTest_RandomUint64();
miruga27 0:dda4f4550403 117
miruga27 0:dda4f4550403 118
miruga27 0:dda4f4550403 119 /**
miruga27 0:dda4f4550403 120 * Returns random Sint64.
miruga27 0:dda4f4550403 121 *
miruga27 0:dda4f4550403 122 * \returns Generated signed integer
miruga27 0:dda4f4550403 123 */
miruga27 0:dda4f4550403 124 Sint64 SDLTest_RandomSint64();
miruga27 0:dda4f4550403 125
miruga27 0:dda4f4550403 126 /**
miruga27 0:dda4f4550403 127 * \returns random float in range [0.0 - 1.0[
miruga27 0:dda4f4550403 128 */
miruga27 0:dda4f4550403 129 float SDLTest_RandomUnitFloat();
miruga27 0:dda4f4550403 130
miruga27 0:dda4f4550403 131 /**
miruga27 0:dda4f4550403 132 * \returns random double in range [0.0 - 1.0[
miruga27 0:dda4f4550403 133 */
miruga27 0:dda4f4550403 134 double SDLTest_RandomUnitDouble();
miruga27 0:dda4f4550403 135
miruga27 0:dda4f4550403 136 /**
miruga27 0:dda4f4550403 137 * \returns random float.
miruga27 0:dda4f4550403 138 *
miruga27 0:dda4f4550403 139 */
miruga27 0:dda4f4550403 140 float SDLTest_RandomFloat();
miruga27 0:dda4f4550403 141
miruga27 0:dda4f4550403 142 /**
miruga27 0:dda4f4550403 143 * \returns random double.
miruga27 0:dda4f4550403 144 *
miruga27 0:dda4f4550403 145 */
miruga27 0:dda4f4550403 146 double SDLTest_RandomDouble();
miruga27 0:dda4f4550403 147
miruga27 0:dda4f4550403 148 /**
miruga27 0:dda4f4550403 149 * Returns a random boundary value for Uint8 within the given boundaries.
miruga27 0:dda4f4550403 150 * Boundaries are inclusive, see the usage examples below. If validDomain
miruga27 0:dda4f4550403 151 * is true, the function will only return valid boundaries, otherwise non-valid
miruga27 0:dda4f4550403 152 * boundaries are also possible.
miruga27 0:dda4f4550403 153 * If boundary1 > boundary2, the values are swapped
miruga27 0:dda4f4550403 154 *
miruga27 0:dda4f4550403 155 * Usage examples:
miruga27 0:dda4f4550403 156 * RandomUint8BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
miruga27 0:dda4f4550403 157 * RandomUint8BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
miruga27 0:dda4f4550403 158 * RandomUint8BoundaryValue(0, 99, SDL_FALSE) returns 100
miruga27 0:dda4f4550403 159 * RandomUint8BoundaryValue(0, 255, SDL_FALSE) returns 0 (error set)
miruga27 0:dda4f4550403 160 *
miruga27 0:dda4f4550403 161 * \param boundary1 Lower boundary limit
miruga27 0:dda4f4550403 162 * \param boundary2 Upper boundary limit
miruga27 0:dda4f4550403 163 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
miruga27 0:dda4f4550403 164 *
miruga27 0:dda4f4550403 165 * \returns Random boundary value for the given range and domain or 0 with error set
miruga27 0:dda4f4550403 166 */
miruga27 0:dda4f4550403 167 Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain);
miruga27 0:dda4f4550403 168
miruga27 0:dda4f4550403 169 /**
miruga27 0:dda4f4550403 170 * Returns a random boundary value for Uint16 within the given boundaries.
miruga27 0:dda4f4550403 171 * Boundaries are inclusive, see the usage examples below. If validDomain
miruga27 0:dda4f4550403 172 * is true, the function will only return valid boundaries, otherwise non-valid
miruga27 0:dda4f4550403 173 * boundaries are also possible.
miruga27 0:dda4f4550403 174 * If boundary1 > boundary2, the values are swapped
miruga27 0:dda4f4550403 175 *
miruga27 0:dda4f4550403 176 * Usage examples:
miruga27 0:dda4f4550403 177 * RandomUint16BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
miruga27 0:dda4f4550403 178 * RandomUint16BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
miruga27 0:dda4f4550403 179 * RandomUint16BoundaryValue(0, 99, SDL_FALSE) returns 100
miruga27 0:dda4f4550403 180 * RandomUint16BoundaryValue(0, 0xFFFF, SDL_FALSE) returns 0 (error set)
miruga27 0:dda4f4550403 181 *
miruga27 0:dda4f4550403 182 * \param boundary1 Lower boundary limit
miruga27 0:dda4f4550403 183 * \param boundary2 Upper boundary limit
miruga27 0:dda4f4550403 184 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
miruga27 0:dda4f4550403 185 *
miruga27 0:dda4f4550403 186 * \returns Random boundary value for the given range and domain or 0 with error set
miruga27 0:dda4f4550403 187 */
miruga27 0:dda4f4550403 188 Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain);
miruga27 0:dda4f4550403 189
miruga27 0:dda4f4550403 190 /**
miruga27 0:dda4f4550403 191 * Returns a random boundary value for Uint32 within the given boundaries.
miruga27 0:dda4f4550403 192 * Boundaries are inclusive, see the usage examples below. If validDomain
miruga27 0:dda4f4550403 193 * is true, the function will only return valid boundaries, otherwise non-valid
miruga27 0:dda4f4550403 194 * boundaries are also possible.
miruga27 0:dda4f4550403 195 * If boundary1 > boundary2, the values are swapped
miruga27 0:dda4f4550403 196 *
miruga27 0:dda4f4550403 197 * Usage examples:
miruga27 0:dda4f4550403 198 * RandomUint32BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
miruga27 0:dda4f4550403 199 * RandomUint32BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
miruga27 0:dda4f4550403 200 * RandomUint32BoundaryValue(0, 99, SDL_FALSE) returns 100
miruga27 0:dda4f4550403 201 * RandomUint32BoundaryValue(0, 0xFFFFFFFF, SDL_FALSE) returns 0 (with error set)
miruga27 0:dda4f4550403 202 *
miruga27 0:dda4f4550403 203 * \param boundary1 Lower boundary limit
miruga27 0:dda4f4550403 204 * \param boundary2 Upper boundary limit
miruga27 0:dda4f4550403 205 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
miruga27 0:dda4f4550403 206 *
miruga27 0:dda4f4550403 207 * \returns Random boundary value for the given range and domain or 0 with error set
miruga27 0:dda4f4550403 208 */
miruga27 0:dda4f4550403 209 Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain);
miruga27 0:dda4f4550403 210
miruga27 0:dda4f4550403 211 /**
miruga27 0:dda4f4550403 212 * Returns a random boundary value for Uint64 within the given boundaries.
miruga27 0:dda4f4550403 213 * Boundaries are inclusive, see the usage examples below. If validDomain
miruga27 0:dda4f4550403 214 * is true, the function will only return valid boundaries, otherwise non-valid
miruga27 0:dda4f4550403 215 * boundaries are also possible.
miruga27 0:dda4f4550403 216 * If boundary1 > boundary2, the values are swapped
miruga27 0:dda4f4550403 217 *
miruga27 0:dda4f4550403 218 * Usage examples:
miruga27 0:dda4f4550403 219 * RandomUint64BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
miruga27 0:dda4f4550403 220 * RandomUint64BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
miruga27 0:dda4f4550403 221 * RandomUint64BoundaryValue(0, 99, SDL_FALSE) returns 100
miruga27 0:dda4f4550403 222 * RandomUint64BoundaryValue(0, 0xFFFFFFFFFFFFFFFF, SDL_FALSE) returns 0 (with error set)
miruga27 0:dda4f4550403 223 *
miruga27 0:dda4f4550403 224 * \param boundary1 Lower boundary limit
miruga27 0:dda4f4550403 225 * \param boundary2 Upper boundary limit
miruga27 0:dda4f4550403 226 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
miruga27 0:dda4f4550403 227 *
miruga27 0:dda4f4550403 228 * \returns Random boundary value for the given range and domain or 0 with error set
miruga27 0:dda4f4550403 229 */
miruga27 0:dda4f4550403 230 Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain);
miruga27 0:dda4f4550403 231
miruga27 0:dda4f4550403 232 /**
miruga27 0:dda4f4550403 233 * Returns a random boundary value for Sint8 within the given boundaries.
miruga27 0:dda4f4550403 234 * Boundaries are inclusive, see the usage examples below. If validDomain
miruga27 0:dda4f4550403 235 * is true, the function will only return valid boundaries, otherwise non-valid
miruga27 0:dda4f4550403 236 * boundaries are also possible.
miruga27 0:dda4f4550403 237 * If boundary1 > boundary2, the values are swapped
miruga27 0:dda4f4550403 238 *
miruga27 0:dda4f4550403 239 * Usage examples:
miruga27 0:dda4f4550403 240 * RandomSint8BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
miruga27 0:dda4f4550403 241 * RandomSint8BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
miruga27 0:dda4f4550403 242 * RandomSint8BoundaryValue(SINT8_MIN, 99, SDL_FALSE) returns 100
miruga27 0:dda4f4550403 243 * RandomSint8BoundaryValue(SINT8_MIN, SINT8_MAX, SDL_FALSE) returns SINT8_MIN (== error value) with error set
miruga27 0:dda4f4550403 244 *
miruga27 0:dda4f4550403 245 * \param boundary1 Lower boundary limit
miruga27 0:dda4f4550403 246 * \param boundary2 Upper boundary limit
miruga27 0:dda4f4550403 247 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
miruga27 0:dda4f4550403 248 *
miruga27 0:dda4f4550403 249 * \returns Random boundary value for the given range and domain or SINT8_MIN with error set
miruga27 0:dda4f4550403 250 */
miruga27 0:dda4f4550403 251 Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain);
miruga27 0:dda4f4550403 252
miruga27 0:dda4f4550403 253
miruga27 0:dda4f4550403 254 /**
miruga27 0:dda4f4550403 255 * Returns a random boundary value for Sint16 within the given boundaries.
miruga27 0:dda4f4550403 256 * Boundaries are inclusive, see the usage examples below. If validDomain
miruga27 0:dda4f4550403 257 * is true, the function will only return valid boundaries, otherwise non-valid
miruga27 0:dda4f4550403 258 * boundaries are also possible.
miruga27 0:dda4f4550403 259 * If boundary1 > boundary2, the values are swapped
miruga27 0:dda4f4550403 260 *
miruga27 0:dda4f4550403 261 * Usage examples:
miruga27 0:dda4f4550403 262 * RandomSint16BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
miruga27 0:dda4f4550403 263 * RandomSint16BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
miruga27 0:dda4f4550403 264 * RandomSint16BoundaryValue(SINT16_MIN, 99, SDL_FALSE) returns 100
miruga27 0:dda4f4550403 265 * RandomSint16BoundaryValue(SINT16_MIN, SINT16_MAX, SDL_FALSE) returns SINT16_MIN (== error value) with error set
miruga27 0:dda4f4550403 266 *
miruga27 0:dda4f4550403 267 * \param boundary1 Lower boundary limit
miruga27 0:dda4f4550403 268 * \param boundary2 Upper boundary limit
miruga27 0:dda4f4550403 269 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
miruga27 0:dda4f4550403 270 *
miruga27 0:dda4f4550403 271 * \returns Random boundary value for the given range and domain or SINT16_MIN with error set
miruga27 0:dda4f4550403 272 */
miruga27 0:dda4f4550403 273 Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain);
miruga27 0:dda4f4550403 274
miruga27 0:dda4f4550403 275 /**
miruga27 0:dda4f4550403 276 * Returns a random boundary value for Sint32 within the given boundaries.
miruga27 0:dda4f4550403 277 * Boundaries are inclusive, see the usage examples below. If validDomain
miruga27 0:dda4f4550403 278 * is true, the function will only return valid boundaries, otherwise non-valid
miruga27 0:dda4f4550403 279 * boundaries are also possible.
miruga27 0:dda4f4550403 280 * If boundary1 > boundary2, the values are swapped
miruga27 0:dda4f4550403 281 *
miruga27 0:dda4f4550403 282 * Usage examples:
miruga27 0:dda4f4550403 283 * RandomSint32BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
miruga27 0:dda4f4550403 284 * RandomSint32BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
miruga27 0:dda4f4550403 285 * RandomSint32BoundaryValue(SINT32_MIN, 99, SDL_FALSE) returns 100
miruga27 0:dda4f4550403 286 * RandomSint32BoundaryValue(SINT32_MIN, SINT32_MAX, SDL_FALSE) returns SINT32_MIN (== error value)
miruga27 0:dda4f4550403 287 *
miruga27 0:dda4f4550403 288 * \param boundary1 Lower boundary limit
miruga27 0:dda4f4550403 289 * \param boundary2 Upper boundary limit
miruga27 0:dda4f4550403 290 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
miruga27 0:dda4f4550403 291 *
miruga27 0:dda4f4550403 292 * \returns Random boundary value for the given range and domain or SINT32_MIN with error set
miruga27 0:dda4f4550403 293 */
miruga27 0:dda4f4550403 294 Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain);
miruga27 0:dda4f4550403 295
miruga27 0:dda4f4550403 296 /**
miruga27 0:dda4f4550403 297 * Returns a random boundary value for Sint64 within the given boundaries.
miruga27 0:dda4f4550403 298 * Boundaries are inclusive, see the usage examples below. If validDomain
miruga27 0:dda4f4550403 299 * is true, the function will only return valid boundaries, otherwise non-valid
miruga27 0:dda4f4550403 300 * boundaries are also possible.
miruga27 0:dda4f4550403 301 * If boundary1 > boundary2, the values are swapped
miruga27 0:dda4f4550403 302 *
miruga27 0:dda4f4550403 303 * Usage examples:
miruga27 0:dda4f4550403 304 * RandomSint64BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
miruga27 0:dda4f4550403 305 * RandomSint64BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
miruga27 0:dda4f4550403 306 * RandomSint64BoundaryValue(SINT64_MIN, 99, SDL_FALSE) returns 100
miruga27 0:dda4f4550403 307 * RandomSint64BoundaryValue(SINT64_MIN, SINT64_MAX, SDL_FALSE) returns SINT64_MIN (== error value) and error set
miruga27 0:dda4f4550403 308 *
miruga27 0:dda4f4550403 309 * \param boundary1 Lower boundary limit
miruga27 0:dda4f4550403 310 * \param boundary2 Upper boundary limit
miruga27 0:dda4f4550403 311 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
miruga27 0:dda4f4550403 312 *
miruga27 0:dda4f4550403 313 * \returns Random boundary value for the given range and domain or SINT64_MIN with error set
miruga27 0:dda4f4550403 314 */
miruga27 0:dda4f4550403 315 Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain);
miruga27 0:dda4f4550403 316
miruga27 0:dda4f4550403 317
miruga27 0:dda4f4550403 318 /**
miruga27 0:dda4f4550403 319 * Returns integer in range [min, max] (inclusive).
miruga27 0:dda4f4550403 320 * Min and max values can be negative values.
miruga27 0:dda4f4550403 321 * If Max in smaller tham min, then the values are swapped.
miruga27 0:dda4f4550403 322 * Min and max are the same value, that value will be returned.
miruga27 0:dda4f4550403 323 *
miruga27 0:dda4f4550403 324 * \param min Minimum inclusive value of returned random number
miruga27 0:dda4f4550403 325 * \param max Maximum inclusive value of returned random number
miruga27 0:dda4f4550403 326 *
miruga27 0:dda4f4550403 327 * \returns Generated random integer in range
miruga27 0:dda4f4550403 328 */
miruga27 0:dda4f4550403 329 Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
miruga27 0:dda4f4550403 330
miruga27 0:dda4f4550403 331
miruga27 0:dda4f4550403 332 /**
miruga27 0:dda4f4550403 333 * Generates random null-terminated string. The minimum length for
miruga27 0:dda4f4550403 334 * the string is 1 character, maximum length for the string is 255
miruga27 0:dda4f4550403 335 * characters and it can contain ASCII characters from 32 to 126.
miruga27 0:dda4f4550403 336 *
miruga27 0:dda4f4550403 337 * Note: Returned string needs to be deallocated.
miruga27 0:dda4f4550403 338 *
miruga27 0:dda4f4550403 339 * \returns Newly allocated random string; or NULL if length was invalid or string could not be allocated.
miruga27 0:dda4f4550403 340 */
miruga27 0:dda4f4550403 341 char * SDLTest_RandomAsciiString();
miruga27 0:dda4f4550403 342
miruga27 0:dda4f4550403 343
miruga27 0:dda4f4550403 344 /**
miruga27 0:dda4f4550403 345 * Generates random null-terminated string. The maximum length for
miruga27 0:dda4f4550403 346 * the string is defined by the maxLength parameter.
miruga27 0:dda4f4550403 347 * String can contain ASCII characters from 32 to 126.
miruga27 0:dda4f4550403 348 *
miruga27 0:dda4f4550403 349 * Note: Returned string needs to be deallocated.
miruga27 0:dda4f4550403 350 *
miruga27 0:dda4f4550403 351 * \param maxLength The maximum length of the generated string.
miruga27 0:dda4f4550403 352 *
miruga27 0:dda4f4550403 353 * \returns Newly allocated random string; or NULL if maxLength was invalid or string could not be allocated.
miruga27 0:dda4f4550403 354 */
miruga27 0:dda4f4550403 355 char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
miruga27 0:dda4f4550403 356
miruga27 0:dda4f4550403 357
miruga27 0:dda4f4550403 358 /**
miruga27 0:dda4f4550403 359 * Generates random null-terminated string. The length for
miruga27 0:dda4f4550403 360 * the string is defined by the size parameter.
miruga27 0:dda4f4550403 361 * String can contain ASCII characters from 32 to 126.
miruga27 0:dda4f4550403 362 *
miruga27 0:dda4f4550403 363 * Note: Returned string needs to be deallocated.
miruga27 0:dda4f4550403 364 *
miruga27 0:dda4f4550403 365 * \param size The length of the generated string
miruga27 0:dda4f4550403 366 *
miruga27 0:dda4f4550403 367 * \returns Newly allocated random string; or NULL if size was invalid or string could not be allocated.
miruga27 0:dda4f4550403 368 */
miruga27 0:dda4f4550403 369 char * SDLTest_RandomAsciiStringOfSize(int size);
miruga27 0:dda4f4550403 370
miruga27 0:dda4f4550403 371 /**
miruga27 0:dda4f4550403 372 * Returns the invocation count for the fuzzer since last ...FuzzerInit.
miruga27 0:dda4f4550403 373 */
miruga27 0:dda4f4550403 374 int SDLTest_GetFuzzerInvocationCount();
miruga27 0:dda4f4550403 375
miruga27 0:dda4f4550403 376 /* Ends C function definitions when using C++ */
miruga27 0:dda4f4550403 377 #ifdef __cplusplus
miruga27 0:dda4f4550403 378 }
miruga27 0:dda4f4550403 379 #endif
miruga27 0:dda4f4550403 380 #include "close_code.h"
miruga27 0:dda4f4550403 381
miruga27 0:dda4f4550403 382 #endif /* _SDL_test_fuzzer_h */
miruga27 0:dda4f4550403 383
miruga27 0:dda4f4550403 384 /* vi: set ts=4 sw=4 expandtab: */