[Mono-list] Test Case for mono exception that does not happen in mint
Daniel Morgan
danmorg@sc.rr.com
Sat, 11 May 2002 12:30:47 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_0004_01C1F8E7.ADBB1F60
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
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
------=_NextPart_000_0004_01C1F8E7.ADBB1F60
Content-Type: text/plain;
name="InvalidArrayIndexTestCase.cs"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="InvalidArrayIndexTestCase.cs"
//=0A=
// InvalidArrayIndexTestCase.cs=0A=
//=0A=
=0A=
using System;=0A=
using System.Collections;=0A=
using System.Data;=0A=
=0A=
namespace Test.Case.For.Some.Bug {=0A=
public class claseeTestCaseDriver {=0A=
=0A=
[STAThread]
static void Main(string[] args) {
bool b;
SomeTestCase tc =3D new SomeTestCase();
b =3D tc.Read();
}
}
=0A=
public sealed class SomeTestCase =0A=
{=0A=
private DbType[] dbTypes;=0A=
=0A=
private int rows =3D 3;=0A=
private int cols =3D 6;=0A=
=0A=
private int currentRow =3D -1;=0A=
=0A=
public bool Read() {=0A=
Int32 c;=0A=
string dataValue;=0A=
DbType tp =3D DbType.Boolean;=0A=
=0A=
Console.WriteLine("if current row: " + currentRow + " rows: " + =
rows); =0A=
if(currentRow < rows - 1) {=0A=
=0A=
Console.WriteLine("currentRow++: ");=0A=
currentRow++;=0A=
=0A=
Console.WriteLine("re-init row --- cols: " + cols);=0A=
=0A=
// re-init row=0A=
dbTypes =3D new DbType[cols];=0A=
bool b;=0A=
=0A=
Console.WriteLine("Before for");=0A=
for(c =3D 0; c < cols; c++) {=0A=
Console.WriteLine("c: " + c);=0A=
=0A=
dataValue =3D "ack";=0A=
Console.WriteLine("setting dbTypes[c]");=0A=
dbTypes[c] =3D DbType.Boolean;=0A=
=0A=
if(dataValue.Equals("")) {=0A=
b =3D false;=0A=
}=0A=
else {=0A=
b =3D true;=0A=
Console.WriteLine("settng tp");=0A=
tp =3D dbTypes[c];=0A=
}=0A=
}=0A=
Console.WriteLine("returnning true");=0A=
return true;=0A=
}=0A=
return false; =0A=
}=0A=
}=0A=
}=0A=
------=_NextPart_000_0004_01C1F8E7.ADBB1F60--