Dietmar,
I have a test case based on a file I was getting an invalid array index
exception when run in mono, but not in mint.  However, I wasn't able to
narrow that down.  I did however create a test case that has a Null
exception for mono, but works in mint and on ms.net.

It seems to do with setting an element in an array of Enums.

I compiled this using mcs InvalidArrayIndexTestCase.cs -r
System.Data.dll
And ran using mono InvalidArrayIndexTestCase.exe

Hope this helps you.
Daniel

//
// InvalidArrayIndexTestCase.cs
//

using System;
using System.Collections;
using System.Data;

namespace Test.Case.For.Some.Bug {
        public class claseeTestCaseDriver {

                [STAThread]
                static void Main(string[] args) {
                        bool b;
                        SomeTestCase tc = new SomeTestCase();
                        b = tc.Read();
                }
        }
        
        public sealed class SomeTestCase 
        {
                private DbType[] dbTypes;
                                                
                private int rows = 3;
                private int cols = 6;

                private int currentRow = -1;
                
                public bool Read() {
                        Int32 c;
                        string dataValue;
                        DbType tp = DbType.Boolean;
                                                
                        Console.WriteLine("if current row: " + currentRow + " rows: " 
+ rows); 
                        if(currentRow < rows - 1)  {
                                
                                Console.WriteLine("currentRow++: ");
                                currentRow++;

                                Console.WriteLine("re-init row --- cols: " + cols);

                                // re-init row
                                dbTypes = new DbType[cols];
                                bool b;
                        
                                Console.WriteLine("Before for");
                                for(c = 0; c < cols; c++) {
                                        Console.WriteLine("c: " + c);
                                                                        
                                        dataValue = "ack";
                                        Console.WriteLine("setting dbTypes[c]");
                                        dbTypes[c] = DbType.Boolean;

                                        if(dataValue.Equals("")) {
                                                b = false;
                                        }
                                        else {
                                                b = true;
                                                Console.WriteLine("settng tp");
                                                tp = dbTypes[c];
                                        }
                                }
                                Console.WriteLine("returnning true");
                                return true;
                        }
                        return false; 
                }
        }
}

Reply via email to