Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Unified Diff: test/mjsunit/fuzz-natives.js

Issue 598011: Changed fuzzer to randomly remove half of the arguments when running... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/fuzz-natives.js
===================================================================
--- test/mjsunit/fuzz-natives.js (revision 3816)
+++ test/mjsunit/fuzz-natives.js (working copy)
@@ -27,6 +27,9 @@
// Flags: --allow-natives-syntax
+var RUN_WITH_ALL_ARGUMENT_ENTRIES = false;
+var kOnManyArgumentsRemove = 5;
+
function makeArguments() {
var result = [ ];
result.push(17);
@@ -74,13 +77,23 @@
var func = makeFunction(name, argc);
while (hasMore) {
var argPool = makeArguments();
+ // When we have 5 or more arguments we lower the amount of tests cases
+ // by randomly removing kOnManyArgumentsRemove entries
+ var numArguments = RUN_WITH_ALL_ARGUMENT_ENTRIES ?
+ kArgObjects : kArgObjects-kOnManyArgumentsRemove;
+ if (argc >= 5 && !RUN_WITH_ALL_ARGUMENT_ENTRIES) {
+ for (var i = 0; i < kOnManyArgumentsRemove; i++) {
+ var rand = Math.floor(Math.random() * (kArgObjects - i));
+ argPool.splice(rand,1);
Mads Ager (chromium) 2010/02/09 12:04:14 nit: add a space after the comma.
+ }
+ }
var current = type;
var hasMore = false;
var argList = [ ];
for (var i = 0; i < argc; i++) {
- var index = current % kArgObjects;
- current = (current / kArgObjects) << 0;
- if (index != (kArgObjects - 1))
+ var index = current % numArguments;
+ current = (current / numArguments) << 0;
+ if (index != (numArguments - 1))
hasMore = true;
argList.push(argPool[index]);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698