shorter, random diff/patch fuzz test; clarify comments

This commit is contained in:
David Greenspan
2012-04-24 09:28:16 -07:00
parent 2614ad84bd
commit 7e8279f245
2 changed files with 9 additions and 5 deletions

View File

@@ -429,8 +429,11 @@ Tinytest.add("liveui - preserved nodes (diff/patch)", function(test) {
return buf;
};
for(var i=0; i<20; i++) {
rand = new SeededRandom("preserved nodes "+i);
for(var i=0; i<5; i++) {
// Use non-deterministic randomness so we can have a shorter fuzz
// test (fewer iterations). For deterministic (fully seeded)
// randomness, remove the call to Math.random().
rand = new SeededRandom("preserved nodes "+i+" "+Math.random());
var R = ReactiveVar(false);
var structure = randomNodeList(null, 4);

View File

@@ -187,10 +187,11 @@ Tinytest.addAsync("mongo-livedata - fuzz test", function(test, onComplete) {
var step = 0;
// Random integer in [0,n)
// use SeededRandom test helper to allow for deterministic results.
// comment out random input to use seeded mode
// Use non-deterministic randomness so we can have a shorter fuzz
// test (fewer iterations). For deterministic (fully seeded)
// randomness, remove the call to Math.random().
var seededRandom = new SeededRandom("foobard" + Math.random());
// Random integer in [0,n)
var rnd = function (n) {
return seededRandom.nextIntBetween(0, n-1);
};