[gxml] Removed warnings on performance tests
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] Removed warnings on performance tests
- Date: Wed, 15 Apr 2015 00:35:56 +0000 (UTC)
commit 0bc464be0d59da0a77c93c0e18c331d7e9bc08b6
Author: Daniel Espinosa <esodan gmail com>
Date: Tue Apr 14 14:38:48 2015 -0500
Removed warnings on performance tests
test/gxml-performance.vala | 91 +++++++++++++++++++++++++++-----------------
1 files changed, 56 insertions(+), 35 deletions(-)
---
diff --git a/test/gxml-performance.vala b/test/gxml-performance.vala
index d239278..cb884ce 100644
--- a/test/gxml-performance.vala
+++ b/test/gxml-performance.vala
@@ -77,49 +77,70 @@ public class Performance
{
Test.add_func ("/gxml/performance/document",
() => {
- Test.timer_start ();
- double time;
- var d = new xDocument.from_path (GXmlTest.get_test_dir () + "/test-large.xml");
- time = Test.timer_elapsed ();
- Test.minimized_result (time, "Load large document: %g seconds", time);
- Test.timer_start ();
- foreach (GXml.xNode n in ((GXml.xNode)d.document_element).child_nodes) {
- if (n.node_name == "Book1") { /* Fake just to access the node */ }
+ try {
+ Test.timer_start ();
+ double time;
+ var d = new xDocument.from_path (GXmlTest.get_test_dir () + "/test-large.xml");
+ time = Test.timer_elapsed ();
+ Test.minimized_result (time, "Load large document: %g seconds", time);
+ Test.timer_start ();
+ foreach (GXml.xNode n in ((GXml.xNode)d.document_element).child_nodes) {
+ if (n.node_name == "Book1") { /* Fake just to access the node */ }
+ }
+ time = Test.timer_elapsed ();
+ Test.minimized_result (time, "Itirate over all loaded nodes: %g seconds", time);
+ } catch (GLib.Error e) {
+#if DEBUG
+ GLib.message ("ERROR: "+e.message);
+#endif
+ assert_not_reached ();
}
- time = Test.timer_elapsed ();
- Test.minimized_result (time, "Itirate over all loaded nodes: %g seconds", time);
});
Test.add_func ("/gxml/performance/deserialize",
() => {
- double time;
- Test.timer_start ();
- var d = new xDocument.from_path (GXmlTest.get_test_dir () + "/test-large.xml");
- time = Test.timer_elapsed ();
- Test.minimized_result (time, "open document from path: %g seconds", time);
- Test.timer_start ();
- var bs = new BookStore ();
- bs.deserialize (d);
- time = Test.timer_elapsed ();
- Test.minimized_result (time, "deserialize/performance: %g seconds", time);
+ try {
+ double time;
+ Test.timer_start ();
+ var d = new xDocument.from_path (GXmlTest.get_test_dir () + "/test-large.xml");
+ time = Test.timer_elapsed ();
+ Test.minimized_result (time, "open document from path: %g seconds", time);
+ Test.timer_start ();
+ var bs = new BookStore ();
+ bs.deserialize (d);
+ time = Test.timer_elapsed ();
+ Test.minimized_result (time, "deserialize/performance: %g seconds", time);
+ } catch (GLib.Error e) {
+#if DEBUG
+ GLib.message ("ERROR: "+e.message);
+#endif
+ assert_not_reached ();
+ }
});
Test.add_func ("/gxml/performance/serialize",
() => {
- double time;
- Test.timer_start ();
- var d = new xDocument.from_path (GXmlTest.get_test_dir () + "/test-large.xml");
- time = Test.timer_elapsed ();
- Test.minimized_result (time, "open document from path: %g seconds", time);
- Test.timer_start ();
- var bs = new BookStore ();
- bs.deserialize (d);
- time = Test.timer_elapsed ();
- Test.minimized_result (time, "deserialize/performance: %g seconds", time);
- Test.timer_start ();
- var d2 = new xDocument ();
- bs.serialize (d2);
- time = Test.timer_elapsed ();
- Test.minimized_result (time, "serialize/performance: %g seconds", time);
+ try {
+ double time;
+ Test.timer_start ();
+ var d = new xDocument.from_path (GXmlTest.get_test_dir () + "/test-large.xml");
+ time = Test.timer_elapsed ();
+ Test.minimized_result (time, "open document from path: %g seconds", time);
+ Test.timer_start ();
+ var bs = new BookStore ();
+ bs.deserialize (d);
+ time = Test.timer_elapsed ();
+ Test.minimized_result (time, "deserialize/performance: %g seconds", time);
+ Test.timer_start ();
+ var d2 = new xDocument ();
+ bs.serialize (d2);
+ time = Test.timer_elapsed ();
+ Test.minimized_result (time, "serialize/performance: %g seconds", time);
+ } catch (GLib.Error e) {
+#if DEBUG
+ GLib.message ("ERROR: "+e.message);
+#endif
+ assert_not_reached ();
+ }
});
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]