include/SDL_test_fuzzer.h
author David Ludwig <dludwig@pobox.com>
Sat, 29 Nov 2014 10:09:30 -0500
changeset 9247 eddb899239fe
parent 9233 b8eaf9623c0b
child 9619 b94b6d0bff0f
permissions -rw-r--r--
WinRT: bug and data-integrity fixes for SDL_GetPrefPath()

This change does a few things, all with regards to the WinRT implementation of
SDL_GetPrefPath():

1. it fixes a bug whereby SDL_GetPrefPath() did not create the directory it
returned. On other SDL platforms, SDL_GetPrefPath() will create separate
directories for its 'org' and 'app' folders. Without this, attempts to create
files in the pref-path would fail, unless those directories were first created
by the app, or by some other library the app used. This change makes sure
that these directories get created, before SDL_GetPrefPath() returns to its
caller(s).


2. it defaults to having SDL_GetPrefPath() return a WinRT 'Local' folder
on all platforms. Previously, for Windows Store apps, it would have used a
different, 'Roaming' folder. Files in Roaming folders can be automatically,
and synchronized across multiple devices by Windows. This synchronization can
happen while the app runs, with new files being copied into a running app's
pref-path. Unless an app is specifically designed to handle this scenario,
there is a chance that save-data could be overwritten in unwanted or
unexpected ways.

The default is now to use a Local folder, which does not get synchronized, and
which is arguably a bit safer to use. Apps that wish to use Roaming folders
can do so by setting SDL_HINT_WINRT_PREF_PATH_ROOT to "roaming", however it
is recommended that one first read Microsoft's documentation for Roaming
files, a link to which is provided in README-winrt.md.

To preserve older pref-path selection behavior (found in SDL 2.0.3, as well as
many pre-2.0.4 versions of SDL from hg.libsdl.org), which uses a Roaming path
in Windows Store apps, and a Local path in Windows Phone, set
SDL_HINT_WINRT_PREF_PATH_ROOT to "old".

Please note that Roaming paths are not supported on Windows Phone 8.0, due to
limitations in the OS itself. Attempts to use this will fail.
(Windows Phone 8.1 does not have this limitation, however.)


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