Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
7d8de2d4
Commit
7d8de2d4
authored
Aug 17, 2011
by
Markus Kauppila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed RandomInteger to RandomSint32 and RandomUnsignedInteger
to RandomUint32.
parent
38ba3e64
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
19 deletions
+19
-19
fuzzer.c
test/test-automation/src/libSDLtest/fuzzer/fuzzer.c
+16
-16
fuzzer.h
test/test-automation/src/libSDLtest/fuzzer/fuzzer.h
+2
-2
testdummy.c
test/test-automation/tests/testdummy/testdummy.c
+1
-1
No files found.
test/test-automation/src/libSDLtest/fuzzer/fuzzer.c
View file @
7d8de2d4
...
@@ -130,13 +130,13 @@ RandomSint16()
...
@@ -130,13 +130,13 @@ RandomSint16()
}
}
Sint32
Sint32
Random
Integer
()
Random
Sint32
()
{
{
return
(
Sint32
)
utl_randomInt
(
&
rndContext
);
return
(
Sint32
)
utl_randomInt
(
&
rndContext
);
}
}
Uint32
Uint32
Random
PositiveInteger
()
Random
Uint32
()
{
{
return
(
Uint32
)
utl_randomInt
(
&
rndContext
);
return
(
Uint32
)
utl_randomInt
(
&
rndContext
);
}
}
...
@@ -147,8 +147,8 @@ RandomUint64()
...
@@ -147,8 +147,8 @@ RandomUint64()
Uint64
value
;
Uint64
value
;
Uint32
*
vp
=
(
Uint32
*
)
&
value
;
Uint32
*
vp
=
(
Uint32
*
)
&
value
;
vp
[
0
]
=
Random
Integer
();
vp
[
0
]
=
Random
Sint32
();
vp
[
1
]
=
Random
Integer
();
vp
[
1
]
=
Random
Sint32
();
return
value
;
return
value
;
}
}
...
@@ -159,8 +159,8 @@ RandomSint64()
...
@@ -159,8 +159,8 @@ RandomSint64()
Uint64
value
;
Uint64
value
;
Uint32
*
vp
=
(
Uint32
*
)
&
value
;
Uint32
*
vp
=
(
Uint32
*
)
&
value
;
vp
[
0
]
=
Random
Integer
();
vp
[
0
]
=
Random
Sint32
();
vp
[
1
]
=
Random
Integer
();
vp
[
1
]
=
Random
Sint32
();
return
value
;
return
value
;
}
}
...
@@ -180,7 +180,7 @@ RandomIntegerInRange(Sint32 pMin, Sint32 pMax)
...
@@ -180,7 +180,7 @@ RandomIntegerInRange(Sint32 pMin, Sint32 pMax)
return
min
;
return
min
;
}
}
Sint32
number
=
abs
(
utl_randomInt
(
&
rndContext
)
);
Sint32
number
=
RandomSint32
(
);
return
(
number
%
((
max
+
1
)
-
min
))
+
min
;
return
(
number
%
((
max
+
1
)
-
min
))
+
min
;
}
}
...
@@ -287,7 +287,7 @@ RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain)
...
@@ -287,7 +287,7 @@ RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain)
return
0
;
return
0
;
}
}
Uint32
index
=
Random
Integer
()
%
size
;
Uint32
index
=
Random
Sint32
()
%
size
;
Uint8
retVal
=
(
Uint8
)
buffer
[
index
];
Uint8
retVal
=
(
Uint8
)
buffer
[
index
];
SDL_free
(
buffer
);
SDL_free
(
buffer
);
...
@@ -311,7 +311,7 @@ RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDoma
...
@@ -311,7 +311,7 @@ RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDoma
return
0
;
return
0
;
}
}
Uint32
index
=
Random
Integer
()
%
size
;
Uint32
index
=
Random
Sint32
()
%
size
;
Uint16
retVal
=
(
Uint16
)
buffer
[
index
];
Uint16
retVal
=
(
Uint16
)
buffer
[
index
];
SDL_free
(
buffer
);
SDL_free
(
buffer
);
...
@@ -335,7 +335,7 @@ RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDoma
...
@@ -335,7 +335,7 @@ RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDoma
return
0
;
return
0
;
}
}
Uint32
index
=
Random
Integer
()
%
size
;
Uint32
index
=
Random
Sint32
()
%
size
;
Uint32
retVal
=
(
Uint32
)
buffer
[
index
];
Uint32
retVal
=
(
Uint32
)
buffer
[
index
];
SDL_free
(
buffer
);
SDL_free
(
buffer
);
...
@@ -359,7 +359,7 @@ RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDoma
...
@@ -359,7 +359,7 @@ RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDoma
return
0
;
return
0
;
}
}
Uint32
index
=
Random
Integer
()
%
size
;
Uint32
index
=
Random
Sint32
()
%
size
;
Uint64
retVal
=
(
Uint64
)
buffer
[
index
];
Uint64
retVal
=
(
Uint64
)
buffer
[
index
];
SDL_free
(
buffer
);
SDL_free
(
buffer
);
...
@@ -476,7 +476,7 @@ RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain)
...
@@ -476,7 +476,7 @@ RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain)
return
CHAR_MIN
;
return
CHAR_MIN
;
}
}
Uint32
index
=
Random
Integer
()
%
size
;
Uint32
index
=
Random
Sint32
()
%
size
;
Sint8
retVal
=
(
Sint8
)
buffer
[
index
];
Sint8
retVal
=
(
Sint8
)
buffer
[
index
];
SDL_free
(
buffer
);
SDL_free
(
buffer
);
...
@@ -501,7 +501,7 @@ RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDoma
...
@@ -501,7 +501,7 @@ RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDoma
return
SHRT_MIN
;
return
SHRT_MIN
;
}
}
Uint32
index
=
Random
Integer
()
%
size
;
Uint32
index
=
Random
Sint32
()
%
size
;
Sint16
retVal
=
(
Sint16
)
buffer
[
index
];
Sint16
retVal
=
(
Sint16
)
buffer
[
index
];
SDL_free
(
buffer
);
SDL_free
(
buffer
);
...
@@ -526,7 +526,7 @@ RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDoma
...
@@ -526,7 +526,7 @@ RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDoma
return
INT_MIN
;
return
INT_MIN
;
}
}
Uint32
index
=
Random
Integer
()
%
size
;
Uint32
index
=
Random
Sint32
()
%
size
;
Sint32
retVal
=
(
Sint32
)
buffer
[
index
];
Sint32
retVal
=
(
Sint32
)
buffer
[
index
];
SDL_free
(
buffer
);
SDL_free
(
buffer
);
...
@@ -551,7 +551,7 @@ RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDoma
...
@@ -551,7 +551,7 @@ RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDoma
return
LLONG_MIN
;
return
LLONG_MIN
;
}
}
Uint32
index
=
Random
Integer
()
%
size
;
Uint32
index
=
Random
Sint32
()
%
size
;
Sint64
retVal
=
(
Sint64
)
buffer
[
index
];
Sint64
retVal
=
(
Sint64
)
buffer
[
index
];
SDL_free
(
buffer
);
SDL_free
(
buffer
);
...
@@ -599,7 +599,7 @@ RandomAsciiStringWithMaximumLength(int maxSize)
...
@@ -599,7 +599,7 @@ RandomAsciiStringWithMaximumLength(int maxSize)
return
NULL
;
return
NULL
;
}
}
int
size
=
(
abs
(
Random
Integer
())
%
(
maxSize
+
1
))
+
1
;
int
size
=
(
abs
(
Random
Sint32
())
%
(
maxSize
+
1
))
+
1
;
char
*
string
=
SDL_malloc
(
size
*
sizeof
(
char
));
char
*
string
=
SDL_malloc
(
size
*
sizeof
(
char
));
int
counter
=
0
;
int
counter
=
0
;
...
...
test/test-automation/src/libSDLtest/fuzzer/fuzzer.h
View file @
7d8de2d4
...
@@ -80,7 +80,7 @@ Sint16 RandomSint16();
...
@@ -80,7 +80,7 @@ Sint16 RandomSint16();
*
*
* \returns Generated integer
* \returns Generated integer
*/
*/
Sint32
Random
Integer
();
Sint32
Random
Sint32
();
/*!
/*!
...
@@ -88,7 +88,7 @@ Sint32 RandomInteger();
...
@@ -88,7 +88,7 @@ Sint32 RandomInteger();
*
*
* \returns Generated integer
* \returns Generated integer
*/
*/
Uint32
Random
PositiveInteger
();
Uint32
Random
Uint32
();
/*!
/*!
* Returns random Uint64.
* Returns random Uint64.
...
...
test/test-automation/tests/testdummy/testdummy.c
View file @
7d8de2d4
...
@@ -98,7 +98,7 @@ test_dummy1(void *arg)
...
@@ -98,7 +98,7 @@ test_dummy1(void *arg)
/*
/*
for( ; 1 ; )
for( ; 1 ; )
Log(0, "uint8 (same value): %u", Random
PositiveInteger
());
Log(0, "uint8 (same value): %u", Random
Uint32
());
// */
// */
//Log(0, "uint8 (same value): %d", RandomUint8BoundaryValue(200, 200, SDL_TRUE));
//Log(0, "uint8 (same value): %d", RandomUint8BoundaryValue(200, 200, SDL_TRUE));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment