[rygel] tests: Fix for recent bugfixes
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] tests: Fix for recent bugfixes
- Date: Fri, 26 Jul 2013 16:11:34 +0000 (UTC)
commit 41e1d5ee32256dfbae81f9404a60f4ba22d849f1
Author: Jens Georg <jensg openismus com>
Date: Wed Jul 24 13:10:05 2013 +0200
tests: Fix for recent bugfixes
tests/rygel-http-get-test.vala | 2 +-
tests/rygel-http-time-seek-test.vala | 2 +-
tests/rygel-object-creator-test.vala | 12 ++++++++----
3 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/tests/rygel-http-get-test.vala b/tests/rygel-http-get-test.vala
index 82c4d18..09ea964 100644
--- a/tests/rygel-http-get-test.vala
+++ b/tests/rygel-http-get-test.vala
@@ -43,7 +43,7 @@ public class Rygel.ClientHacks {
}
}
- public void apply (MediaItem? item) {
+ public void apply (MediaObject? item) {
}
public bool force_seek () {
diff --git a/tests/rygel-http-time-seek-test.vala b/tests/rygel-http-time-seek-test.vala
index 9892e30..e916c68 100644
--- a/tests/rygel-http-time-seek-test.vala
+++ b/tests/rygel-http-time-seek-test.vala
@@ -283,7 +283,7 @@ private class Rygel.HTTPTimeSeekTest : GLib.Object {
assert (seek != null);
assert (seek.start == start);
- assert (seek.stop == stop);
+ assert (seek.stop == stop - 1);
assert (seek.length == seek.stop + TimeSpan.MILLISECOND - seek.start);
var audio_item = request.object as AudioItem;
diff --git a/tests/rygel-object-creator-test.vala b/tests/rygel-object-creator-test.vala
index f2cbb45..95bd5e4 100644
--- a/tests/rygel-object-creator-test.vala
+++ b/tests/rygel-object-creator-test.vala
@@ -221,6 +221,7 @@ public class Rygel.MediaContainer : Rygel.MediaObject {
public int child_count { get; set; }
public string sort_criteria = "+dc:title";
public static const string ANY = "DLNA.ORG_AnyContainer";
+ public static const string UPNP_CLASS = "object.container";
public static const string STORAGE_FOLDER =
"object.container.storageFolder";
public static const string PLAYLIST =
@@ -282,6 +283,7 @@ public class Rygel.SearchableContainer : Rygel.MediaContainer {
public errordomain Rygel.ContentDirectoryError {
BAD_METADATA,
NO_SUCH_OBJECT,
+ NO_SUCH_CONTAINER,
INVALID_ARGS,
RESTRICTED_PARENT,
ERROR
@@ -353,12 +355,14 @@ public class Rygel.HTTPObjectCreatorTest : GLib.Object {
// expected errors
Error no_such_object;
+ Error no_such_container;
Error restricted_parent;
Error bad_metadata;
Error invalid_args;
public HTTPObjectCreatorTest () {
this.no_such_object = new ContentDirectoryError.NO_SUCH_OBJECT("");
+ this.no_such_container = new ContentDirectoryError.NO_SUCH_CONTAINER("");
this.restricted_parent = new ContentDirectoryError.RESTRICTED_PARENT("");
this.bad_metadata = new ContentDirectoryError.BAD_METADATA("");
this.invalid_args = new ContentDirectoryError.INVALID_ARGS("");
@@ -428,7 +432,7 @@ public class Rygel.HTTPObjectCreatorTest : GLib.Object {
// test item node with restricted=1
tmp->set_prop ("restricted", "1");
- this.test_didl_parsing_step (xml, invalid_args.code);
+ this.test_didl_parsing_step (xml, bad_metadata.code);
// test item node with invalid id
tmp->unlink ();
@@ -475,13 +479,13 @@ public class Rygel.HTTPObjectCreatorTest : GLib.Object {
var action = new ServiceAction ("0", DIDL_ITEM);
var creator = new ObjectCreator (content_directory, action);
this.test_fetch_container_run (creator);
- assert (action.error_code == no_such_object.code);
+ assert (action.error_code == no_such_container.code);
// check case when found object is not a container → Error 710
// cf. ContentDirectory:2 spec, Table 2-22
root_container.found_object = new MediaObject ();
this.test_fetch_container_run (creator);
- assert (action.error_code == no_such_object.code);
+ assert (action.error_code == no_such_container.code);
// check case when found container does not have OCMUpload set
root_container.found_object = new MediaContainer ();
@@ -505,7 +509,7 @@ public class Rygel.HTTPObjectCreatorTest : GLib.Object {
content_directory.root_container = new MediaContainer ();
action.id = "DLNA.ORG_AnyContainer";
this.test_fetch_container_run (creator);
- assert (action.error_code == no_such_object.code);
+ assert (action.error_code == no_such_container.code);
// check DLNA.ORG_AnyContainer when no writable container is found
content_directory.root_container = new SearchableContainer ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]