[gxml] Fixed Unit Tests for TDocument
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] Fixed Unit Tests for TDocument
- Date: Thu, 27 Oct 2016 21:36:27 +0000 (UTC)
commit 82436c28befd3353a7ed579a1581f3f4263f9699
Author: Daniel Espinosa <esodan gmail com>
Date: Thu Oct 27 16:35:24 2016 -0500
Fixed Unit Tests for TDocument
gxml/TDocument.vala | 3 ---
test/TDocumentTest.vala | 5 +++++
2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gxml/TDocument.vala b/gxml/TDocument.vala
index 72fe49b..835404e 100644
--- a/gxml/TDocument.vala
+++ b/gxml/TDocument.vala
@@ -148,9 +148,6 @@ public class GXml.TDocument : GXml.TNode, GXml.Document
_root = (GXml.Element) n;
}
}
- if (found > 1) {
- GLib.warning (_("Document has more than one root GXmlElement. Using first found"));
- }
}
return _root;
}
diff --git a/test/TDocumentTest.vala b/test/TDocumentTest.vala
index 3207e56..5f764aa 100644
--- a/test/TDocumentTest.vala
+++ b/test/TDocumentTest.vala
@@ -737,6 +737,11 @@ class TDocumentTest : GXmlTest {
var file = GLib.File.new_for_path
(GXmlTestConfig.TEST_DIR+"/t-read-test.xml");
assert (file.query_exists ());
var d = new TDocument.from_file (file);
+ assert (d.children_nodes != null);
+ assert (d.children_nodes.size == 3);
+ assert (d.children_nodes[0] is GXml.Comment);
+ assert (d.children_nodes[1] is GXml.ProcessingInstruction);
+ assert (d.children_nodes[2] is GXml.Element);
assert (d.root != null);
assert (d.root.children_nodes.size == 7);
var n = d.root.children_nodes[6];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]