Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ee0bc0d176
Fetching contributors…

Cannot retrieve contributors at this time

file 34 lines (28 sloc) 0.71 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
using System;

struct Foo<T> {
public T t;
public Foo (T t) { this.t = t; }
}

/*This is a WB-stress based test */

public class Driver<T> {
public static void Fill (int cycles, Func<int, T> mk_entry) {
const int array_len = 9975;
Foo<T>[] root = new Foo<T> [array_len];
for (int i = 0; i < cycles; ++i) {
for (int j = 0; j < array_len; ++j)
root [j] = new Foo<T> (mk_entry (j));
}

for (int i = 0; i < array_len; ++i)
if (root [i].Equals (mk_entry (i)))
throw new Exception ("Invalid value at position " + i);
}
}

class Driver {

static void Main () {
int loops = 40;
int cycles = 40;
for (int i = 0; i < loops; ++i) {
Driver<object>.Fill (cycles, (k) => k);
}
}
}
Something went wrong with that request. Please try again.