Modified:
branches/5.1/Client.build
branches/5.1/TestSuite/Source/DataReaderTests.cs
branches/5.1/TestSuite/Source/DataTypeTests.cs
branches/5.1/TestSuite/Source/DateTimeTests.cs
branches/5.1/TestSuite/Source/GetSchemaTests.cs
branches/5.1/TestSuite/Source/MicroPerfTests.cs
branches/5.1/TestSuite/Source/ParameterTests.cs
branches/5.1/TestSuite/Source/SimpleTransactions.cs
branches/5.1/TestSuite/Source/StoredProcedure.cs
branches/5.1/TestSuite/Source/Syntax.cs
branches/5.1/TestSuite/Source/TimeoutAndCancel.cs
branches/5.1/TestSuite/Source/Transactions.cs
branches/5.1/TestSuite/Source/UsageAdvisor.cs
Log:
yet more cleanups
Modified: branches/5.1/Client.build
===================================================================
--- branches/5.1/Client.build 2008-01-09 21:13:17 UTC (rev 1145)
+++ branches/5.1/Client.build 2008-01-09 21:25:40 UTC (rev 1146)
@@ -48,7 +48,7 @@
<csc output="${outdir}/MySql.Data.dll" target="library"
define="TRACE,${defines}" debug="${debug}" optimize="${opt}"
doc="${outdir}/MySql.Data.xml">
- <arg value="/nowarn:0679,1591,2029"/>
+ <arg value="/nowarn:0679,1591,1592,2029"/>
<resources prefix="MySql.Data.MySqlClient.Source">
<include name="Driver/Source/Resources.resources"/>
<include name="Driver/Source/ReservedWords.txt"/>
@@ -70,7 +70,7 @@
define="TRACE,${defines}" debug="${debug}" optimize="${opt}">
<arg value="/nowarn:0679,2029"/>
<sources>
- <include name="TestSuite/source/*.cs" />
+ <include name="TestSuite/Source/*.cs" />
</sources>
<references>
<include name="${outdir}/MySql.Data.dll"/>
Modified: branches/5.1/TestSuite/Source/DataReaderTests.cs
===================================================================
--- branches/5.1/TestSuite/Source/DataReaderTests.cs 2008-01-09 21:13:17 UTC (rev 1145)
+++ branches/5.1/TestSuite/Source/DataReaderTests.cs 2008-01-09 21:25:40 UTC (rev 1146)
@@ -796,7 +796,7 @@
{
reader = cmd.ExecuteReader();
reader.Read();
- string s = reader.GetString(reader.GetOrdinal("Sub_part"));
+ reader.GetString(reader.GetOrdinal("Sub_part"));
Assert.Fail("We should not get here");
}
catch (System.Data.SqlTypes.SqlNullValueException)
Modified: branches/5.1/TestSuite/Source/DataTypeTests.cs
===================================================================
--- branches/5.1/TestSuite/Source/DataTypeTests.cs 2008-01-09 21:13:17 UTC (rev 1145)
+++ branches/5.1/TestSuite/Source/DataTypeTests.cs 2008-01-09 21:25:40 UTC (rev 1146)
@@ -534,6 +534,7 @@
Assert.AreEqual(1, dt.Rows.Count);
Assert.AreEqual(1, dt.Rows[0]["id"]);
Assert.AreEqual(23.4, dt.Rows[0]["dec1"]);
+ cb.Dispose();
}
[Test]
@@ -681,6 +682,7 @@
row["b"] = 135;
row.EndEdit();
da.Update(dv.Table);
+ cb.Dispose();
execSQL("DROP TABLE IF EXISTS Test");
execSQL("CREATE TABLE Test (b MEDIUMINT UNSIGNED PRIMARY KEY)");
Modified: branches/5.1/TestSuite/Source/DateTimeTests.cs
===================================================================
--- branches/5.1/TestSuite/Source/DateTimeTests.cs 2008-01-09 21:13:17 UTC (rev 1145)
+++ branches/5.1/TestSuite/Source/DateTimeTests.cs 2008-01-09 21:25:40 UTC (rev 1146)
@@ -201,6 +201,7 @@
Assert.AreEqual(2003, date.Year);
Assert.AreEqual(9, date.Month);
Assert.AreEqual(24, date.Day);
+ cb.Dispose();
}
catch (Exception ex)
{
@@ -239,6 +240,7 @@
dt.Clear();
da.Fill(dt);
+ cb.Dispose();
Assert.AreEqual(1, dt.Rows.Count);
Assert.AreEqual(now.Date, ((DateTime)dt.Rows[0]["dt"]).Date );
@@ -457,6 +459,7 @@
dt.Rows.Clear();
da.Fill(dt);
Assert.AreEqual(2, dt.Rows.Count);
+ cb.Dispose();
}
catch (Exception ex)
{
Modified: branches/5.1/TestSuite/Source/GetSchemaTests.cs
===================================================================
--- branches/5.1/TestSuite/Source/GetSchemaTests.cs 2008-01-09 21:13:17 UTC (rev 1145)
+++ branches/5.1/TestSuite/Source/GetSchemaTests.cs 2008-01-09 21:25:40 UTC (rev 1146)
@@ -534,7 +534,7 @@
try
{
- DataTable dt = conn.GetSchema("Foreign Keys");
+ conn.GetSchema("Foreign Keys");
}
catch (Exception ex)
{
Modified: branches/5.1/TestSuite/Source/MicroPerfTests.cs
===================================================================
--- branches/5.1/TestSuite/Source/MicroPerfTests.cs 2008-01-09 21:13:17 UTC (rev 1145)
+++ branches/5.1/TestSuite/Source/MicroPerfTests.cs 2008-01-09 21:25:40 UTC (rev 1146)
@@ -49,7 +49,6 @@
}
TimeSpan ts = DateTime.Now.Subtract(start);
- double secs = ts.TotalSeconds;
}
}
}
Modified: branches/5.1/TestSuite/Source/ParameterTests.cs
===================================================================
--- branches/5.1/TestSuite/Source/ParameterTests.cs 2008-01-09 21:13:17 UTC (rev 1145)
+++ branches/5.1/TestSuite/Source/ParameterTests.cs 2008-01-09 21:25:40 UTC (rev 1146)
@@ -180,7 +180,6 @@
{
try
{
- IDbConnection conn2 = (IDbConnection)conn;
IDbCommand cmd = conn.CreateCommand();
IDbDataParameter prm = cmd.CreateParameter();
prm.DbType = DbType.Int64;
@@ -501,6 +500,7 @@
cmd.Parameters.Add("?id6", MySqlDbType.Int32);
cmd.Parameters.RemoveAt("?id1");
MySqlParameter p = cmd.Parameters["?id6"];
+ Assert.AreEqual("?id6", p.ParameterName);
}
/// <summary>
Modified: branches/5.1/TestSuite/Source/SimpleTransactions.cs
===================================================================
--- branches/5.1/TestSuite/Source/SimpleTransactions.cs 2008-01-09 21:13:17 UTC (rev 1145)
+++ branches/5.1/TestSuite/Source/SimpleTransactions.cs 2008-01-09 21:25:40 UTC (rev 1146)
@@ -103,7 +103,7 @@
c.Close();
try
{
- MySqlTransaction t = c.BeginTransaction();
+ c.BeginTransaction();
}
catch (Exception ex)
{
Modified: branches/5.1/TestSuite/Source/StoredProcedure.cs
===================================================================
--- branches/5.1/TestSuite/Source/StoredProcedure.cs 2008-01-09 21:13:17 UTC (rev 1145)
+++ branches/5.1/TestSuite/Source/StoredProcedure.cs 2008-01-09 21:25:40 UTC (rev 1146)
@@ -571,7 +571,6 @@
MySqlCommand cmd = new MySqlCommand("spTest", conn);
cmd.CommandType = CommandType.StoredProcedure;
- MySqlDataAdapter da = new MySqlDataAdapter(cmd);
MySqlCommandBuilder.DeriveParameters(cmd);
Assert.AreEqual(9, cmd.Parameters.Count);
@@ -616,7 +615,6 @@
cmd.CommandText = "spTest";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Clear();
- da = new MySqlDataAdapter(cmd);
MySqlCommandBuilder.DeriveParameters(cmd);
Assert.AreEqual(0, cmd.Parameters.Count);
}
@@ -636,7 +634,6 @@
MySqlCommand cmd = new MySqlCommand("fnTest", conn);
cmd.CommandType = CommandType.StoredProcedure;
- MySqlDataAdapter da = new MySqlDataAdapter(cmd);
MySqlCommandBuilder.DeriveParameters(cmd);
Assert.AreEqual(2, cmd.Parameters.Count);
Modified: branches/5.1/TestSuite/Source/Syntax.cs
===================================================================
--- branches/5.1/TestSuite/Source/Syntax.cs 2008-01-09 21:13:17 UTC (rev 1145)
+++ branches/5.1/TestSuite/Source/Syntax.cs 2008-01-09 21:25:40 UTC (rev 1146)
@@ -417,7 +417,7 @@
MySqlCommand cmd = new MySqlCommand("SELEKT NOW() as theTime", conn);
try
{
- object o = cmd.ExecuteScalar();
+ cmd.ExecuteScalar();
}
catch (MySqlException ex)
{
Modified: branches/5.1/TestSuite/Source/TimeoutAndCancel.cs
===================================================================
--- branches/5.1/TestSuite/Source/TimeoutAndCancel.cs 2008-01-09 21:13:17 UTC (rev 1145)
+++ branches/5.1/TestSuite/Source/TimeoutAndCancel.cs 2008-01-09 21:25:40 UTC (rev 1146)
@@ -61,7 +61,7 @@
// now we start execution of the command
CommandInvokerDelegate d = new CommandInvokerDelegate(CommandRunner);
- IAsyncResult iar = d.BeginInvoke(cmd, null, null);
+ d.BeginInvoke(cmd, null, null);
// sleep 5 seconds
Thread.Sleep(5000);
@@ -91,7 +91,7 @@
try
{
cmd.CommandText = "SELECT now()";
- object date = cmd.ExecuteScalar();
+ cmd.ExecuteScalar();
}
catch (Exception) { }
Assert.AreEqual(1, stateChangeCount);
Modified: branches/5.1/TestSuite/Source/Transactions.cs
===================================================================
--- branches/5.1/TestSuite/Source/Transactions.cs 2008-01-09 21:13:17 UTC (rev 1145)
+++ branches/5.1/TestSuite/Source/Transactions.cs 2008-01-09 21:25:40 UTC (rev 1146)
@@ -156,14 +156,14 @@
MySqlConnection c = new MySqlConnection(connStr);
c.Open();
MySqlCommand cmd = new MySqlCommand("INSERT INTO Test VALUES (1)", c);
- MySqlTransaction tx = c.BeginTransaction();
+ c.BeginTransaction();
cmd.ExecuteNonQuery();
c.Close();
MySqlConnection c2 = new MySqlConnection(connStr);
c2.Open();
MySqlCommand cmd2 = new MySqlCommand("SELECT COUNT(*) from Test", c2);
- MySqlTransaction tx2 = c2.BeginTransaction();
+ c2.BeginTransaction();
object count = cmd2.ExecuteScalar();
c2.Close();
Assert.AreEqual(0, count);
@@ -174,7 +174,7 @@
/// <summary>
/// Bug #22042 mysql-connector-net-5.0.0-alpha BeginTransaction
/// </summary>
- void Bug22042()
+ public void Bug22042()
{
DbProviderFactory factory =
new MySql.Data.MySqlClient.MySqlClientFactory();
Modified: branches/5.1/TestSuite/Source/UsageAdvisor.cs
===================================================================
--- branches/5.1/TestSuite/Source/UsageAdvisor.cs 2008-01-09 21:13:17 UTC (rev 1145)
+++ branches/5.1/TestSuite/Source/UsageAdvisor.cs 2008-01-09 21:25:40 UTC (rev 1146)
@@ -60,7 +60,7 @@
{
reader = cmd.ExecuteReader();
reader.Read();
- int id = reader.GetInt32(0);
+ reader.GetInt32(0); // access the first field
reader.Read();
Assert.IsTrue(reader.NextResult());
| Thread |
|---|
| • Connector/NET commit: r1146 - in branches/5.1: . TestSuite/Source | rburnett | 9 Jan |