[ease: 5/9] Added a testing function.



commit ddbcaa1d67334756cefb50bb6746321355160ba3
Author: Nate Stedman <natesm gmail com>
Date:   Sun May 30 16:36:41 2010 -0400

    Added a testing function.

 src/Main.vala        |    2 ++
 src/Transitions.vala |   21 +++++++++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/Main.vala b/src/Main.vala
index 3fc9161..2d3dd6e 100644
--- a/src/Main.vala
+++ b/src/Main.vala
@@ -53,6 +53,8 @@ public static class Ease.Main : GLib.Object
 	 */
 	public static int main(string[] args)
 	{
+		Transitions.test();
+	
 		// parse command line options
 		var context = new OptionContext(_(" - a presentation editor"));
 		
diff --git a/src/Transitions.vala b/src/Transitions.vala
index b5dce50..1a0434f 100644
--- a/src/Transitions.vala
+++ b/src/Transitions.vala
@@ -256,6 +256,27 @@ public static class Ease.Transitions : GLib.Object
 	{
 		return get_name(transitions[index].type);
 	}
+	
+	/**
+	 * Runs a test print of all transitions and variants.
+	 */
+	public static void test()
+	{
+		stdout.printf("%i Transitions:\n", (int)transitions.length);
+		
+		for (int i = 0; i < transitions.length; i++)
+		{
+			stdout.printf("\t%s has %i variants:\n",
+			              get_name(transitions[i].type),
+			              transitions[i].variants.length);
+			
+			for (int j = 0; j < transitions[i].variants.length; i++)
+			{
+				stdout.printf("\t\t%s\n",
+				              get_variant_name(transitions[i].variants[j]));
+			}
+		}
+	}
 }
 
 public struct Ease.Transition



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]