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