[gxml] Added Tests for GDocument
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] Added Tests for GDocument
- Date: Fri, 5 Feb 2016 15:34:57 +0000 (UTC)
commit c5827a91ef1f323ea505e6c99d2c3a21ccc726e2
Author: Daniel Espinosa <esodan gmail com>
Date: Thu Jan 28 19:59:04 2016 -0600
Added Tests for GDocument
gxml/GXmlDocument.vala | 5 +++++
test/GXmlTest.vala | 1 +
test/Makefile.am | 1 +
3 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gxml/GXmlDocument.vala b/gxml/GXmlDocument.vala
index 239d38e..62c0892 100644
--- a/gxml/GXmlDocument.vala
+++ b/gxml/GXmlDocument.vala
@@ -58,6 +58,11 @@ public class GXml.GDocument : GXml.GNode, GXml.Document
if (doc == null)
doc = new Xml.Doc ();
}
+ public GDocument.from_stream (GLib.InputStream istream) {
+ var b = new MemoryOutputStream.resizable ();
+ b.splice (istream, 0);
+ this.from_string ((string) b.data);
+ }
public GDocument.from_doc (Xml.Doc doc) { this.doc = doc; }
// GXml.Node
public override bool set_namespace (string uri, string? prefix)
diff --git a/test/GXmlTest.vala b/test/GXmlTest.vala
index df46144..fe1aa52 100644
--- a/test/GXmlTest.vala
+++ b/test/GXmlTest.vala
@@ -82,6 +82,7 @@ class GXmlTest {
SerializablePropertyIntTest.add_tests ();
SerializablePropertyValueListTest.add_tests ();
SerializablePropertyEnumTest.add_tests ();
+ GDocumentTest.add_tests ();
Test.run ();
diff --git a/test/Makefile.am b/test/Makefile.am
index c9ffb37..b82343e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -60,6 +60,7 @@ sources = \
TwCDATATest.vala \
TwCommentTest.vala \
TwProcessingInstructionTest.vala \
+ GDocumentTest.vala \
$(NULL)
gxml_test.vala.stamp: $(sources)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]