You've already forked linux-packaging-mono
Imported Upstream version 4.2.0.179
Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
committed by
Jo Shields
parent
183bba2c9a
commit
6992685b86
@@ -13,7 +13,7 @@ namespace Monotests_Mono.Data.SqlExpressions
|
||||
DataTable table = new DataTable ();
|
||||
table.Columns.Add ("Col_0.Value", Type.GetType ("System.Int32"));
|
||||
table.Columns.Add ("Col_1", Type.GetType ("System.Int32"));
|
||||
table.Columns.Add ("Result", Type.GetType ("System.Int32"), "IIF(Col_0.Value, Col_1 + 5, 0)");
|
||||
table.Columns.Add ("Result", Type.GetType ("System.Int32"), "IIF(Col_0.Value <> 0, Col_1 + 5, 0)");
|
||||
|
||||
DataRow row = table.NewRow ();
|
||||
row ["Col_0.Value"] = 0;
|
||||
@@ -31,7 +31,7 @@ namespace Monotests_Mono.Data.SqlExpressions
|
||||
dt.Rows.Add (new string [] { null });
|
||||
dt.Rows.Add (new string [] { "xax" });
|
||||
dt.Columns.Add ("c2", typeof (bool), "c1 LIKE '%a%'");
|
||||
Assert.IsFalse ((bool) dt.Rows [0] [1]);
|
||||
//Assert.IsFalse ((bool) dt.Rows [0] [1]); ... cannot cast from DBNull to bool.
|
||||
Assert.IsTrue ((bool) dt.Rows [1] [1]);
|
||||
}
|
||||
|
||||
@@ -120,18 +120,24 @@ namespace Monotests_Mono.Data.SqlExpressions
|
||||
[TestFixture]
|
||||
public class DataColumnCharTest
|
||||
{
|
||||
private static DataTable _dt = new DataTable();
|
||||
DataTable _dt;
|
||||
|
||||
[Test]
|
||||
public void Test1 ()
|
||||
[SetUp]
|
||||
public void Setup ()
|
||||
{
|
||||
_dt = new DataTable();
|
||||
|
||||
_dt.Columns.Add(new DataColumn("a", typeof(char)));
|
||||
|
||||
AddData('1');
|
||||
AddData('2');
|
||||
AddData('3');
|
||||
AddData('A');
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test1 ()
|
||||
{
|
||||
Assert.AreEqual (true, FindRow("'A'"), "Test1-1 failed");
|
||||
Assert.AreEqual (true, FindRow("65"), "Test1-2 failed");
|
||||
Assert.AreEqual (true, FindRow("'1'"), "Test1-3 failed");
|
||||
@@ -143,13 +149,14 @@ namespace Monotests_Mono.Data.SqlExpressions
|
||||
{
|
||||
FindRow("'65'");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test3 ()
|
||||
{
|
||||
Assert.AreEqual (false, FindRow ("1"), "Test3-1 failed");
|
||||
}
|
||||
|
||||
private static bool FindRow(string f)
|
||||
private bool FindRow(string f)
|
||||
{
|
||||
string filter = string.Format("a = {0}", f);
|
||||
|
||||
@@ -161,7 +168,7 @@ namespace Monotests_Mono.Data.SqlExpressions
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void AddData(char a)
|
||||
private void AddData(char a)
|
||||
{
|
||||
DataRow row = _dt.NewRow();
|
||||
row["a"] = a;
|
||||
|
||||
@@ -500,7 +500,7 @@ namespace MonoTests.System.Data.Common {
|
||||
{
|
||||
NonAbstractDBDataPermission empty = new NonAbstractDBDataPermission (PermissionState.None);
|
||||
NonAbstractDBDataPermission union = (NonAbstractDBDataPermission) empty.Union (empty);
|
||||
Assert.IsNotNull (union, "Empty U Empty");
|
||||
Assert.IsNull (union, "Empty U Empty");
|
||||
|
||||
NonAbstractDBDataPermission dbdp1 = new NonAbstractDBDataPermission (PermissionState.None);
|
||||
dbdp1.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.AllowOnly);
|
||||
|
||||
@@ -1 +1 @@
|
||||
a797cf50afab63bc3e3b32e1cc95d46c9c8d5ef8
|
||||
0ff9d109c2cf0e230c09e3069a3bb7a6f7873181
|
||||
@@ -52,7 +52,7 @@ namespace MonoTests.System.Data.Odbc
|
||||
Assert.AreEqual (OdbcType.Int, param.OdbcType, "#2");
|
||||
|
||||
param = new OdbcParameter ("test", 10);
|
||||
Assert.AreEqual (OdbcType.Int, param.OdbcType, "#3");
|
||||
Assert.AreEqual (OdbcType.NVarChar, param.OdbcType, "#3");
|
||||
param.OdbcType = OdbcType.Real;
|
||||
Assert.AreEqual (OdbcType.Real, param.OdbcType, "#4");
|
||||
Assert.AreEqual (10, param.Value, "#5");
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace MonoTests.System.Data.OleDb {
|
||||
public class OleDbParameterCollectionTest {
|
||||
|
||||
[Test]
|
||||
[Category ("NotWorking")] // it tries to PInvoke LocalAlloc() and fails on non-Windows.
|
||||
public void AddWithValueTest ()
|
||||
{
|
||||
OleDbCommand command = new OleDbCommand();
|
||||
|
||||
@@ -423,6 +423,7 @@ namespace MonoTests.System.Data.SqlClient
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: this actually doesn't match .NET behavior. It shouldn't throw NRE.
|
||||
[Test]
|
||||
public void Prepare_Connection_Null ()
|
||||
{
|
||||
@@ -474,7 +475,7 @@ namespace MonoTests.System.Data.SqlClient
|
||||
} catch (NullReferenceException) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Test] // bug #412586
|
||||
public void Prepare_Connection_Closed ()
|
||||
{
|
||||
|
||||
@@ -753,6 +753,7 @@ namespace MonoTests.System.Data.SqlTypes
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")]
|
||||
public void ReadWriteXmlTest ()
|
||||
{
|
||||
string xml1 = "<?xml version=\"1.0\" encoding=\"utf-16\"?><decimal>4556.89756</decimal>";
|
||||
@@ -770,8 +771,8 @@ namespace MonoTests.System.Data.SqlTypes
|
||||
try {
|
||||
ReadWriteXmlTestInternal (xml3, test3, "BA03");
|
||||
Assert.Fail ("BA03");
|
||||
} catch (FormatException e) {
|
||||
Assert.AreEqual (typeof (FormatException), e.GetType (), "#BA03");
|
||||
} catch (InvalidOperationException e) {
|
||||
Assert.AreEqual (typeof (FormatException), e.InnerException.GetType (), "#BA03");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -622,6 +622,7 @@ namespace MonoTests.System.Data.SqlTypes
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")]
|
||||
public void ReadWriteXmlTest ()
|
||||
{
|
||||
string xml1 = "<?xml version=\"1.0\" encoding=\"utf-16\"?><double>4556.99999999999999999988</double>";
|
||||
@@ -637,8 +638,8 @@ namespace MonoTests.System.Data.SqlTypes
|
||||
try {
|
||||
ReadWriteXmlTestInternal (xml3, test3, "BA03");
|
||||
Assert.Fail ("BA03");
|
||||
} catch (FormatException e) {
|
||||
Assert.AreEqual (typeof (FormatException), e.GetType (), "#BA03");
|
||||
} catch (InvalidOperationException e) {
|
||||
Assert.AreEqual (typeof (FormatException), e.InnerException.GetType (), "#BA03");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -727,6 +727,7 @@ namespace MonoTests.System.Data.SqlTypes
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")]
|
||||
public void ReadWriteXmlTest ()
|
||||
{
|
||||
string xml1 = "<?xml version=\"1.0\" encoding=\"utf-16\"?><short>4556</short>";
|
||||
@@ -742,8 +743,8 @@ namespace MonoTests.System.Data.SqlTypes
|
||||
try {
|
||||
ReadWriteXmlTestInternal (xml3, test3, "BA03");
|
||||
Assert.Fail ("BA03");
|
||||
} catch (FormatException e) {
|
||||
Assert.AreEqual (typeof (FormatException), e.GetType (), "#BA03");
|
||||
} catch (InvalidOperationException e) {
|
||||
Assert.AreEqual (typeof (FormatException), e.InnerException.GetType (), "#BA03");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -493,6 +493,7 @@ namespace MonoTests.System.Data.SqlTypes
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")]
|
||||
public void ReadWriteXmlTest ()
|
||||
{
|
||||
string xml1 = "<?xml version=\"1.0\" encoding=\"utf-16\"?><int>4556</int>";
|
||||
@@ -508,8 +509,8 @@ namespace MonoTests.System.Data.SqlTypes
|
||||
try {
|
||||
ReadWriteXmlTestInternal (xml3, test3, "#BA03");
|
||||
Assert.Fail ("BA03");
|
||||
} catch (FormatException e) {
|
||||
Assert.AreEqual (typeof (FormatException), e.GetType (), "#BA03");
|
||||
} catch (InvalidOperationException e) {
|
||||
Assert.AreEqual (typeof (FormatException), e.InnerException.GetType (), "#BA03");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -694,6 +694,7 @@ namespace MonoTests.System.Data.SqlTypes
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")]
|
||||
public void ReadWriteXmlTest ()
|
||||
{
|
||||
string xml1 = "<?xml version=\"1.0\" encoding=\"utf-16\"?><long>4556</long>";
|
||||
@@ -709,8 +710,8 @@ namespace MonoTests.System.Data.SqlTypes
|
||||
try {
|
||||
ReadWriteXmlTestInternal (xml3, lngtest3, "BA03");
|
||||
Assert.Fail ("BA03");
|
||||
} catch (FormatException e) {
|
||||
Assert.AreEqual (typeof (FormatException), e.GetType (), "#BA03");
|
||||
} catch (InvalidOperationException e) {
|
||||
Assert.AreEqual (typeof (FormatException), e.InnerException.GetType (), "#BA03");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,9 +332,7 @@ namespace MonoTests.System.Data
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("NotDotNet")]
|
||||
// Even after EndInit(), MS.NET does not fill Table property
|
||||
// on UniqueConstraint.
|
||||
[Ignore ("Even after EndInit(), .NET does not fill Table property on UniqueConstraint.")]
|
||||
public void TestAddRange2 ()
|
||||
{
|
||||
DataTable table = new DataTable ("Table");
|
||||
@@ -366,10 +364,12 @@ namespace MonoTests.System.Data
|
||||
|
||||
// After EndInit is called the constraints associated with most recent call to AddRange() must be
|
||||
// added to the ConstraintCollection
|
||||
/* dunno if the above is true, but it crashes on .NET either. Disabling.
|
||||
Assert.That (constraints [2].Table.ToString (), Is.EqualTo ("Table"), "#A03");
|
||||
Assert.That (table.Constraints.Contains ("Unique1"), Is.True, "#A04");
|
||||
Assert.That (table.Constraints.Contains ("Unique3"), Is.True, "#A06");
|
||||
Assert.That (table.Constraints.Contains ("Unique2"), Is.True, "#A05");
|
||||
*/
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -410,10 +410,10 @@ namespace MonoTests.System.Data
|
||||
DataColumnCollection Cols2 = Table2.Columns;
|
||||
Assert.IsTrue (Cols2.CanRemove (C), "test#04");
|
||||
|
||||
DataRelation Rel = new DataRelation ("Rel", Table.Columns [0], Table2.Columns [0]);
|
||||
DataSet Set = new DataSet ();
|
||||
Set.Tables.Add (Table);
|
||||
Set.Tables.Add (Table2);
|
||||
DataRelation Rel = new DataRelation ("Rel", Table.Columns [0], Table2.Columns [0]);
|
||||
Set.Relations.Add (Rel);
|
||||
|
||||
Assert.IsFalse (Cols2.CanRemove (C), "test#05");
|
||||
|
||||
@@ -766,12 +766,13 @@ namespace MonoTests.System.Data
|
||||
table2.Columns.Add ("test", typeof(int));
|
||||
table3.Columns.Add ("test", typeof(int));
|
||||
|
||||
DataRelation rel1 = new DataRelation ("rel1", table1.Columns[0], table2.Columns[0]);
|
||||
DataRelation rel2 = new DataRelation ("rel2", table2.Columns[0], table3.Columns[0]);
|
||||
|
||||
ds.Tables.Add (table1);
|
||||
ds.Tables.Add (table2);
|
||||
ds.Tables.Add (table3);
|
||||
|
||||
DataRelation rel1 = new DataRelation ("rel1", table1.Columns[0], table2.Columns[0]);
|
||||
DataRelation rel2 = new DataRelation ("rel2", table2.Columns[0], table3.Columns[0]);
|
||||
|
||||
ds.Relations.Add (rel1);
|
||||
ds.Relations.Add (rel2);
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@ namespace MonoTests.System.Data
|
||||
dc.MaxLength = int.MinValue ;
|
||||
//Checking Get MinValue
|
||||
// MaxLength MinValue
|
||||
Assert.AreEqual(int.MinValue, dc.MaxLength , "DC31");
|
||||
Assert.AreEqual(-1, dc.MaxLength , "DC31");
|
||||
|
||||
DataTable dt = new DataTable();
|
||||
dt.Columns.Add(new DataColumn("col",typeof(string)));
|
||||
|
||||
@@ -304,10 +304,10 @@ namespace MonoTests.System.Data
|
||||
cols [1] = "test3";
|
||||
Table.Rows.Add (cols);
|
||||
|
||||
DataRelation Rel = new DataRelation ("REL", _tbl.Columns [0], Table.Columns [0]);
|
||||
DataSet Set = new DataSet ();
|
||||
Set.Tables.Add (_tbl);
|
||||
Set.Tables.Add (Table);
|
||||
DataRelation Rel = new DataRelation ("REL", _tbl.Columns [0], Table.Columns [0]);
|
||||
Set.Relations.Add (Rel);
|
||||
|
||||
try {
|
||||
|
||||
@@ -2578,7 +2578,7 @@ namespace MonoTests.System.Data
|
||||
drChild.GetParentRows(drl,DataRowVersion.Current);
|
||||
Assert.Fail("DRW129: failed to throw ArgumentException");
|
||||
}
|
||||
catch (ArgumentException) {}
|
||||
catch (InvalidConstraintException) {}
|
||||
catch (AssertionException exc) {throw exc;}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace MonoTests.System.Data
|
||||
//check that the DataRowView has a new DataView
|
||||
// check that the DataRowView has a new DataView
|
||||
dv = new DataView();
|
||||
Assert.AreEqual(false, drv1.DataView.Equals(dv) , "DRV21");
|
||||
Assert.AreEqual(true, drv1.DataView.Equals(dv) , "DRV21");
|
||||
}
|
||||
|
||||
[Test] public void Delete()
|
||||
@@ -359,7 +359,7 @@ namespace MonoTests.System.Data
|
||||
|
||||
dv.RowStateFilter=DataViewRowState.Deleted ;
|
||||
// check Original
|
||||
Assert.AreEqual(DataRowVersion.Original , drv.RowVersion, "DRV47");
|
||||
Assert.AreEqual(DataRowVersion.Current , drv.RowVersion, "DRV47");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ namespace MonoTests.System.Data
|
||||
// namespaces
|
||||
ds = GetDataSet (xml14, null);
|
||||
AssertDataSet ("xml14", ds, "root", 0, 0);
|
||||
Assert.AreEqual ("p", ds.Prefix);
|
||||
Assert.AreEqual (string.Empty, ds.Prefix);
|
||||
Assert.AreEqual ("urn:foo", ds.Namespace);
|
||||
|
||||
ds = GetDataSet (xml17, null);
|
||||
|
||||
@@ -567,9 +567,7 @@ namespace MonoTests.System.Data
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("NotDotNet")]
|
||||
// MS.NET has a bug on handling default value of referenced
|
||||
// attribute.
|
||||
[Ignore (".NET has a bug on handling default value of referenced attribute.")]
|
||||
public void TestSampleFileValueConstraints ()
|
||||
{
|
||||
DataSet ds = new DataSet ();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user