Author: jwilcox
Date: 2005-06-17 18:54:28 -0400 (Fri, 17 Jun 2005)
New Revision: 46180
Modified:
trunk/ipod-sharp/ChangeLog
trunk/ipod-sharp/src/Device.cs
trunk/ipod-sharp/tests/IPodTests.cs
Log:
2005-06-17 James Willcox <[EMAIL PROTECTED]>
* src/Device.cs: update bindings to handle the recently added
GError arguments.
* tests/IPodTests.cs: put funky UTF-8 strings in some of the tests
Modified: trunk/ipod-sharp/ChangeLog
===================================================================
--- trunk/ipod-sharp/ChangeLog 2005-06-17 22:06:37 UTC (rev 46179)
+++ trunk/ipod-sharp/ChangeLog 2005-06-17 22:54:28 UTC (rev 46180)
@@ -1,5 +1,11 @@
2005-06-17 James Willcox <[EMAIL PROTECTED]>
+ * src/Device.cs: update bindings to handle the recently added
+ GError arguments.
+ * tests/IPodTests.cs: put funky UTF-8 strings in some of the tests
+
+2005-06-17 James Willcox <[EMAIL PROTECTED]>
+
* tests/mktest.sh: Fixup a bit, and include more stuff in the tarball
* tests/runtests.sh: Accept a device to test, which makes a test
tarball out of it and runs the tests.
Modified: trunk/ipod-sharp/src/Device.cs
===================================================================
--- trunk/ipod-sharp/src/Device.cs 2005-06-17 22:06:37 UTC (rev 46179)
+++ trunk/ipod-sharp/src/Device.cs 2005-06-17 22:54:28 UTC (rev 46180)
@@ -20,10 +20,10 @@
private static extern bool ipod_device_rescan_disk (IntPtr raw);
[DllImport ("ipoddevice")]
- private static extern uint ipod_device_eject (IntPtr raw);
+ private static extern uint ipod_device_eject (IntPtr raw, out IntPtr
error);
[DllImport ("ipoddevice")]
- private static extern bool ipod_device_save (IntPtr raw);
+ private static extern bool ipod_device_save (IntPtr raw, out IntPtr
error);
[DllImport ("ipoddevice")]
private static extern void ipod_device_debug (IntPtr raw);
@@ -133,21 +133,26 @@
}
public void Eject () {
- EjectResult result = (EjectResult) ipod_device_eject (Raw);
+ IntPtr error = IntPtr.Zero;
+ EjectResult result = (EjectResult) ipod_device_eject (Raw, out
error);
switch (result) {
case EjectResult.Ok:
return;
case EjectResult.Error:
- throw new DeviceException (this, "Could not eject device"); //
FIXME: need better message
+ GLib.GException exc = new GLib.GException (error);
+ throw new DeviceException (this, exc.Message, exc);
case EjectResult.Busy:
throw new DeviceBusyException (this);
}
}
public void Save () {
- if (!ipod_device_save (Raw)) {
- throw new DeviceException (this, "Failed to save");
+ IntPtr error = IntPtr.Zero;
+
+ if (!ipod_device_save (Raw, out error)) {
+ GLib.GException exc = new GLib.GException (error);
+ throw new DeviceException (this, exc.Message, exc);
}
}
Modified: trunk/ipod-sharp/tests/IPodTests.cs
===================================================================
--- trunk/ipod-sharp/tests/IPodTests.cs 2005-06-17 22:06:37 UTC (rev 46179)
+++ trunk/ipod-sharp/tests/IPodTests.cs 2005-06-17 22:54:28 UTC (rev 46180)
@@ -143,17 +143,17 @@
DateTime now = DateTime.Now;
- song.Artist = "TEST ARTIST";
- song.Album = "TEST ALBUM";
+ song.Artist = "عَلَيْكُم";
+ song.Album = "ሠላም";
song.Year = 1000;
song.Length = 9999;
song.TrackNumber = 8;
song.TotalTracks = 9;
song.BitRate = 444;
song.SampleRate = 555;
- song.Title = "TEST TITLE";
- song.Genre = "Metal";
- song.Comment = "test comment";
+ song.Title = "ආයුබෝවන්";
+ song.Genre = "こんにちは";
+ song.Comment = "வணக்கம்";
song.PlayCount = 34;
song.LastPlayed = now;
song.Rating = SongRating.Four;
@@ -164,17 +164,17 @@
song = FindSong (db, id);
Assert.IsNotNull (song);
- Assert.AreEqual ("TEST ARTIST", song.Artist);
- Assert.AreEqual ("TEST ALBUM", song.Album);
+ Assert.AreEqual ("عَلَيْكُم", song.Artist);
+ Assert.AreEqual ("ሠላም", song.Album);
Assert.AreEqual (1000, song.Year);
Assert.AreEqual (9999, song.Length);
Assert.AreEqual (8, song.TrackNumber);
Assert.AreEqual (9, song.TotalTracks);
Assert.AreEqual (444, song.BitRate);
Assert.AreEqual (555, song.SampleRate);
- Assert.AreEqual ("TEST TITLE", song.Title);
- Assert.AreEqual ("Metal", song.Genre);
- Assert.AreEqual ("test comment", song.Comment);
+ Assert.AreEqual ("ආයුබෝවන්", song.Title);
+ Assert.AreEqual ("こんにちは", song.Genre);
+ Assert.AreEqual ("வணக்கம்", song.Comment);
Assert.AreEqual (34, song.PlayCount);
Assert.AreEqual (SongRating.Four, song.Rating);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches