using System; using System.Threading; using csharp_typemapsNamespace; public class runme { static void Main() { // Test the C# types customisation by modifying the default char * typemaps to return a single char Things things = new Things(); System.Text.StringBuilder initialLetters = new System.Text.StringBuilder(); char myChar = things.start("boo"); initialLetters.Append(myChar); myChar = Things.stop("hiss"); initialLetters.Append(myChar); myChar = csharp_typemaps.partyon("off"); initialLetters.Append(myChar); if (initialLetters.ToString() != "bho") throw new Exception("initial letters failed"); // $csinput expansion csharp_typemaps.myInt = 1; try { csharp_typemaps.myInt = -1; throw new Exception("oops"); } catch (ApplicationException) { } // Eager garbage collector test { const int NUM_THREADS = 8; Thread[] threads = new Thread[NUM_THREADS]; TestThread[] testThreads = new TestThread[NUM_THREADS]; // invoke the threads for (int i=0; i