[gnome-calculator] GCalc: renamed Variable to MathVariable



commit 110267fc22153f8db74cd46e2b594a9f24dee753
Author: Daniel Espinosa <esodan gmail com>
Date:   Thu Oct 17 12:54:12 2019 -0500

    GCalc: renamed Variable to MathVariable

 gcalc/gcalc-assign.vala                            |  2 +-
 gcalc/gcalc-expression-container.vala              |  6 +-
 gcalc/gcalc-gvariable.vala                         |  4 +-
 gcalc/gcalc-math-assign.vala                       |  2 +-
 gcalc/gcalc-math-equation-manager.vala             |  6 +-
 gcalc/gcalc-math-parameter.vala                    |  4 +-
 gcalc/gcalc-math-term.vala                         |  4 +-
 ...calc-variable.vala => gcalc-math-variable.vala} | 14 ++---
 gcalc/gcalc-parser.vala                            | 18 +++---
 gcalc/meson.build                                  |  2 +-
 tests/gcalc-parsing.vala                           | 66 +++++++++++-----------
 tests/gcalc-solving-basic.vala                     |  4 +-
 12 files changed, 66 insertions(+), 66 deletions(-)
---
diff --git a/gcalc/gcalc-assign.vala b/gcalc/gcalc-assign.vala
index d74d2f77..04a62f7c 100644
--- a/gcalc/gcalc-assign.vala
+++ b/gcalc/gcalc-assign.vala
@@ -23,7 +23,7 @@ public class GCalc.Assign : Expression, MathOperator, MathBinaryOperator, MathAs
     if (expressions.get_n_items () != 2) {
       return "Invalid Assigment structure";
     }
-    var v = expressions.get_item (0) as Variable;
+    var v = expressions.get_item (0) as MathVariable;
     if (v == null) {
       return "Invalid Assigment structure. No variable is set";
     }
diff --git a/gcalc/gcalc-expression-container.vala b/gcalc/gcalc-expression-container.vala
index 0d4fdfec..5458f81b 100644
--- a/gcalc/gcalc-expression-container.vala
+++ b/gcalc/gcalc-expression-container.vala
@@ -62,12 +62,12 @@ public class GCalc.ExpressionContainer : Gee.ArrayList<MathExpression>, GLib.Lis
   }
 
   public MathExpression? find (MathExpression exp) {
-    unowned Variable? variable = exp as Variable;
+    unowned MathVariable? variable = exp as MathVariable;
     if (variable == null) {
       return null;
     }
     foreach (MathExpression e in this) {
-      if (e is Variable && ((Variable) e).name == variable.name) {
+      if (e is MathVariable && ((MathVariable) e).name == variable.name) {
         return e;
       }
     }
@@ -76,7 +76,7 @@ public class GCalc.ExpressionContainer : Gee.ArrayList<MathExpression>, GLib.Lis
 
   public MathExpression? find_named (string name) {
     foreach (MathExpression e in this) {
-      if (e is Variable && ((Variable) e).name == name) {
+      if (e is MathVariable && ((MathVariable) e).name == name) {
         return e;
       }
       if (e is MathFunction && ((MathFunction) e).name == name) {
diff --git a/gcalc/gcalc-gvariable.vala b/gcalc/gcalc-gvariable.vala
index fa9b5332..b1a15f2d 100644
--- a/gcalc/gcalc-gvariable.vala
+++ b/gcalc/gcalc-gvariable.vala
@@ -18,11 +18,11 @@
  * Authors:
  *      Daniel Espinosa <esodan gmail com>
  */
-public class GCalc.GVariable : Expression, Variable, Hashable {
+public class GCalc.GVariable : Expression, MathVariable, Hashable {
 
   public string name { get; construct set; }
   internal MathConstant value { get; set; }
-  internal Variable bind { get; set; }
+  internal MathVariable bind { get; set; }
 
   construct {
     _value = new Constant.@double (0.0);
diff --git a/gcalc/gcalc-math-assign.vala b/gcalc/gcalc-math-assign.vala
index f661ce42..d5a7f446 100644
--- a/gcalc/gcalc-math-assign.vala
+++ b/gcalc/gcalc-math-assign.vala
@@ -29,7 +29,7 @@ public interface GCalc.MathAssign : Object, MathExpression, MathOperator, MathBi
     if (expressions.get_n_items () != 2) {
       throw new AssigError.INVALID_STRUCTURE_ERROR ("Invalid number of expressions in assign");
     }
-    var v = expressions.get_item (0) as Variable;
+    var v = expressions.get_item (0) as MathVariable;
     if (v == null) {
       throw new AssigError.INVALID_STRUCTURE_ERROR ("Invalid variable object in assign");
     }
diff --git a/gcalc/gcalc-math-equation-manager.vala b/gcalc/gcalc-math-equation-manager.vala
index 1aabc884..5a415b10 100644
--- a/gcalc/gcalc-math-equation-manager.vala
+++ b/gcalc/gcalc-math-equation-manager.vala
@@ -21,14 +21,14 @@
 public interface GCalc.MathEquationManager : Object {
   public abstract ExpressionContainer equations { get; }
   public abstract ExpressionContainer functions { get; }
-  public virtual Variable find_variable (string name) {
-    Variable res = null;
+  public virtual MathVariable find_variable (string name) {
+    MathVariable res = null;
     foreach (MathExpression e in equations) {
       var eq = e as MathEquation;
       if (e == null) {
         continue;
       }
-      var v = eq.variables.find_named (name) as Variable;
+      var v = eq.variables.find_named (name) as MathVariable;
       if (v != null) {
         res = v;
         break;
diff --git a/gcalc/gcalc-math-parameter.vala b/gcalc/gcalc-math-parameter.vala
index 59d8ad29..cb1bbcc3 100644
--- a/gcalc/gcalc-math-parameter.vala
+++ b/gcalc/gcalc-math-parameter.vala
@@ -19,13 +19,13 @@
  *      Daniel Espinosa <esodan gmail com>
  */
 /**
- * A parameter is a {@link Variable} holding a value, that is not
+ * A parameter is a {@link MathVariable} holding a value, that is not
  * expected to be resolved as part of an {@link MathExpression} evaluation,
  * but by asigning its value.
  *
  * Currently the value will be converted to a {@link MathConstant} if possible.
  */
-public interface GCalc.MathParameter : Object, MathExpression, Variable {
+public interface GCalc.MathParameter : Object, MathExpression, MathVariable {
   public abstract void set_value (GLib.Value val) throws GLib.Error;
   public abstract GLib.Value get_value ();
 }
diff --git a/gcalc/gcalc-math-term.vala b/gcalc/gcalc-math-term.vala
index d742d68f..8e5c6a19 100644
--- a/gcalc/gcalc-math-term.vala
+++ b/gcalc/gcalc-math-term.vala
@@ -76,8 +76,8 @@ public interface GCalc.MathTerm : Object, MathExpression {
             current = evaluate_constants ((MathConstant) current, (MathConstant) ev, current_operator);
           }
         }
-      } else if (e is Variable) {
-        var ev = ((Variable) e).evaluate ();
+      } else if (e is MathVariable) {
+        var ev = ((MathVariable) e).evaluate ();
         if (current == null) {
           current = ev;
           first = false;
diff --git a/gcalc/gcalc-variable.vala b/gcalc/gcalc-math-variable.vala
similarity index 76%
rename from gcalc/gcalc-variable.vala
rename to gcalc/gcalc-math-variable.vala
index 1b0e432c..d6f6c17c 100644
--- a/gcalc/gcalc-variable.vala
+++ b/gcalc/gcalc-math-variable.vala
@@ -1,4 +1,4 @@
-/* gcalc-variable.vala
+/* gcalc-math-variable.vala
  *
  * Copyright (C) 2018  Daniel Espinosa <esodan gmail com>
  *
@@ -21,10 +21,10 @@
 /**
  * A variable that can be evaluated from an {@link MathExpression}
  */
-public interface GCalc.Variable : Object, MathExpression {
+public interface GCalc.MathVariable : Object, MathExpression {
   public abstract string name { get; construct set; }
   public abstract MathConstant @value { get; set; }
-  public abstract Variable bind { get; set; }
+  public abstract MathVariable bind { get; set; }
   public virtual bool binded { get { return bind != null; } }
 
   public virtual MathExpression evaluate () throws GLib.Error {
@@ -35,18 +35,18 @@ public interface GCalc.Variable : Object, MathExpression {
       return @value;
     }
     if (parent == null) {
-      throw new VariableError.INVALID_PARENT ("Can't access to Variable's expression definition. Invalid 
parent. Expected Assign operator");
+      throw new VariableError.INVALID_PARENT ("Can't access to MathVariable's expression definition. Invalid 
parent. Expected Assign operator");
     }
     if (parent.expressions.get_n_items () != 2) {
-      throw new VariableError.INVALID_EXPRESSION_DEFINITION ("Can't access to Variable's expression 
definition. Expression not found");
+      throw new VariableError.INVALID_EXPRESSION_DEFINITION ("Can't access to MathVariable's expression 
definition. Expression not found");
     }
     var e = parent.expressions.get_item (1) as MathPolynomial;
     if (e == null) {
-      throw new VariableError.INVALID_EXPRESSION_DEFINITION ("Can't access to Variable's expression 
definition. Unexpected object type");
+      throw new VariableError.INVALID_EXPRESSION_DEFINITION ("Can't access to MathVariable's expression 
definition. Unexpected object type");
     }
     var exp = e.evaluate () as MathConstant;
     if (exp == null) {
-      throw new VariableError.EVALUATION_FAIL ("Variable evaluation fail. Variable's value not updated");
+      throw new VariableError.EVALUATION_FAIL ("MathVariable evaluation fail. MathVariable's value not 
updated");
     }
     @value = exp;
     return exp;
diff --git a/gcalc/gcalc-parser.vala b/gcalc/gcalc-parser.vala
index 6e0060fd..20106652 100644
--- a/gcalc/gcalc-parser.vala
+++ b/gcalc/gcalc-parser.vala
@@ -103,16 +103,16 @@ public class GCalc.Parser : Object {
               v = new Parameter (n) as MathExpression;
               enable_parameter = false;
             }
-            var sv = eqman.find_variable (n) as Variable;
+            var sv = eqman.find_variable (n) as MathVariable;
             if (sv == null) {
-              sv = eq.variables.find_named (n) as Variable;
+              sv = eq.variables.find_named (n) as MathVariable;
               if (sv == null) {
                 eq.variables.add (v);
               } else {
-                ((Variable) v).bind = sv;
+                ((MathVariable) v).bind = sv;
               }
             } else {
-              ((Variable) v).bind = sv;
+              ((MathVariable) v).bind = sv;
             }
             if (current == null) {
               var exp = new Polynomial ();
@@ -186,7 +186,7 @@ public class GCalc.Parser : Object {
             throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression for an assignment");
           } else if (current is MathPolynomial) {
             throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression: can't set a value to 
a polynomial");
-          } else if (current is Variable) {
+          } else if (current is MathVariable) {
             bool removed = false;
             if (current.parent != null) {
               if (current.parent is MathTerm) {
@@ -354,7 +354,7 @@ public class GCalc.Parser : Object {
       current_parent = current;
       current = opp;
       expected.clear ();
-    } else if ((current is MathConstant || current is Variable)
+    } else if ((current is MathConstant || current is MathVariable)
                && current_parent is MathTerm && top_parent is MathPolynomial) {
       // New term
       var t = new Term ();
@@ -372,7 +372,7 @@ public class GCalc.Parser : Object {
       current_parent = t;
       top_parent = current_parent.parent;
       expected.clear ();
-    } else if (current is Variable && current_parent == null) {
+    } else if (current is MathVariable && current_parent == null) {
       // New MathPolynomial
       var exp = new Polynomial ();
       eq.expressions.add (exp);
@@ -392,12 +392,12 @@ public class GCalc.Parser : Object {
     if (current is MathOperator) {
       throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression for a multiply operator");
     }
-    if ((current is MathConstant || current is Variable || current is MathGroup || current is MathFunction)
+    if ((current is MathConstant || current is MathVariable || current is MathGroup || current is 
MathFunction)
         && current_parent is MathTerm && top_parent is MathPolynomial) {
         current_parent.expressions.add (op);
         current = op;
         expected.clear ();
-    } else if (current is Variable && current_parent == null) {
+    } else if (current is MathVariable && current_parent == null) {
       // New MathPolynomial
       var exp = new Polynomial ();
       eq.expressions.add (exp);
diff --git a/gcalc/meson.build b/gcalc/meson.build
index 238a7d0b..af229a93 100644
--- a/gcalc/meson.build
+++ b/gcalc/meson.build
@@ -104,6 +104,7 @@ gcalc_sources = files([
        'gcalc-math-result.vala',
        'gcalc-math-solver.vala',
        'gcalc-math-term.vala',
+       'gcalc-math-variable.vala',
        'gcalc-minus.vala',
        'gcalc-multiply.vala',
        'gcalc-parameter.vala',
@@ -114,7 +115,6 @@ gcalc_sources = files([
        'gcalc-result.vala',
        'gcalc-solver.vala',
        'gcalc-term.vala',
-       'gcalc-variable.vala',
 ])
 
 
diff --git a/tests/gcalc-parsing.vala b/tests/gcalc-parsing.vala
index d4027167..5cb1c440 100644
--- a/tests/gcalc-parsing.vala
+++ b/tests/gcalc-parsing.vala
@@ -91,7 +91,7 @@ class Tests {
         var assign = eq.expressions.get_item (0) as MathAssign;
         assert (assign != null);
         assert (assign.expressions.get_n_items () == 2);
-        var v = assign.expressions.get_item (0) as Variable;
+        var v = assign.expressions.get_item (0) as MathVariable;
         assert (v != null);
         assert (v.name == "var");
         var p = assign.expressions.get_item (1) as MathPolynomial;
@@ -151,14 +151,14 @@ class Tests {
         var t1 = p.expressions.get_item (0) as MathTerm;
         assert (t1 != null);
         assert (t1.expressions.get_n_items () == 1);
-        var c1 = t1.expressions.get_item (0) as Variable;
+        var c1 = t1.expressions.get_item (0) as MathVariable;
         assert (c1 != null);
         var t2 = p.expressions.get_item (1) as MathTerm;
         assert (t2 != null);
         assert (t2.expressions.get_n_items () == 2);
         var plus = t2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
-        var c2 = t2.expressions.get_item (1) as Variable;
+        var c2 = t2.expressions.get_item (1) as MathVariable;
         assert (c2 != null);
       } catch (GLib.Error error) {
         warning ("Error: %s", error.message);
@@ -180,7 +180,7 @@ class Tests {
         var t1 = p.expressions.get_item (0) as MathTerm;
         assert (t1 != null);
         assert (t1.expressions.get_n_items () == 1);
-        var c1 = t1.expressions.get_item (0) as Variable;
+        var c1 = t1.expressions.get_item (0) as MathVariable;
         assert (c1 != null);
         var t2 = p.expressions.get_item (1) as MathTerm;
         assert (t2 != null);
@@ -216,7 +216,7 @@ class Tests {
         assert (t2.expressions.get_n_items () == 2);
         var plus = t2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
-        var c2 = t2.expressions.get_item (1) as Variable;
+        var c2 = t2.expressions.get_item (1) as MathVariable;
         assert (c2 != null);
       } catch (GLib.Error error) {
         warning ("Error: %s", error.message);
@@ -248,7 +248,7 @@ class Tests {
         assert (t2.expressions.get_n_items () == 2);
         var plus = t2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
-        var c2 = t2.expressions.get_item (1) as Variable;
+        var c2 = t2.expressions.get_item (1) as MathVariable;
         assert (c2 != null);
         var t3 = p.expressions.get_item (2) as MathTerm;
         assert (t3 != null);
@@ -262,7 +262,7 @@ class Tests {
         assert (t4.expressions.get_n_items () == 2);
         var plus3 = t4.expressions.get_item (0) as MathPlus;
         assert (plus3 != null);
-        var c4 = t4.expressions.get_item (1) as Variable;
+        var c4 = t4.expressions.get_item (1) as MathVariable;
         assert (c4 != null);
       } catch (GLib.Error error) {
         warning ("Error: %s", error.message);
@@ -294,7 +294,7 @@ class Tests {
         assert (t2.expressions.get_n_items () == 2);
         var plus = t2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
-        var c2 = t2.expressions.get_item (1) as Variable;
+        var c2 = t2.expressions.get_item (1) as MathVariable;
         assert (c2 != null);
         var t3 = p.expressions.get_item (2) as MathTerm;
         assert (t3 != null);
@@ -308,7 +308,7 @@ class Tests {
         assert (t4.expressions.get_n_items () == 2);
         var minus2 = t4.expressions.get_item (0) as MathMinus;
         assert (minus2 != null);
-        var c4 = t4.expressions.get_item (1) as Variable;
+        var c4 = t4.expressions.get_item (1) as MathVariable;
         assert (c4 != null);
       } catch (GLib.Error error) {
         warning ("Error: %s", error.message);
@@ -357,11 +357,11 @@ class Tests {
         var t1 = p.expressions.get_item (0) as MathTerm;
         assert (t1 != null);
         assert (t1.expressions.get_n_items () == 3);
-        var c1 = t1.expressions.get_item (0) as Variable;
+        var c1 = t1.expressions.get_item (0) as MathVariable;
         assert (c1 != null);
         var m = t1.expressions.get_item (1) as MathMultiply;
         assert (m != null);
-        var c2 = t1.expressions.get_item (2) as Variable;
+        var c2 = t1.expressions.get_item (2) as MathVariable;
         assert (c2 != null);
       } catch (GLib.Error error) {
         warning ("Error: %s", error.message);
@@ -390,7 +390,7 @@ class Tests {
         assert (c1 != null);
         var m1 = t1.expressions.get_item (2) as MathMultiply;
         assert (m1 != null);
-        var c2 = t1.expressions.get_item (3) as Variable;
+        var c2 = t1.expressions.get_item (3) as MathVariable;
         assert (c2 != null);
         var t2 = p.expressions.get_item (1) as MathTerm;
         assert (t2 != null);
@@ -401,7 +401,7 @@ class Tests {
         assert (c3 != null);
         var m2 = t2.expressions.get_item (2) as MathMultiply;
         assert (m2 != null);
-        var c4 = t2.expressions.get_item (3) as Variable;
+        var c4 = t2.expressions.get_item (3) as MathVariable;
         assert (c4 != null);
       } catch (GLib.Error error) {
         warning ("Error: %s", error.message);
@@ -450,11 +450,11 @@ class Tests {
         var t1 = p.expressions.get_item (0) as MathTerm;
         assert (t1 != null);
         assert (t1.expressions.get_n_items () == 3);
-        var c1 = t1.expressions.get_item (0) as Variable;
+        var c1 = t1.expressions.get_item (0) as MathVariable;
         assert (c1 != null);
         var m = t1.expressions.get_item (1) as MathDivision;
         assert (m != null);
-        var c2 = t1.expressions.get_item (2) as Variable;
+        var c2 = t1.expressions.get_item (2) as MathVariable;
         assert (c2 != null);
       } catch (GLib.Error error) {
         warning ("Error: %s", error.message);
@@ -483,7 +483,7 @@ class Tests {
         assert (c1 != null);
         var m1 = t1.expressions.get_item (2) as MathDivision;
         assert (m1 != null);
-        var c2 = t1.expressions.get_item (3) as Variable;
+        var c2 = t1.expressions.get_item (3) as MathVariable;
         assert (c2 != null);
         var t2 = p.expressions.get_item (1) as MathTerm;
         assert (t2 != null);
@@ -494,7 +494,7 @@ class Tests {
         assert (c3 != null);
         var m2 = t2.expressions.get_item (2) as MathMultiply;
         assert (m2 != null);
-        var c4 = t2.expressions.get_item (3) as Variable;
+        var c4 = t2.expressions.get_item (3) as MathVariable;
         assert (c4 != null);
         var m3 = t2.expressions.get_item (4) as MathDivision;
         assert (m3 != null);
@@ -825,7 +825,7 @@ class Tests {
         var a = eq.expressions.get_item (0) as MathAssign;
         assert (a != null);
         assert (a.expressions.get_n_items () == 2);
-        var v = a.expressions.get_item (0) as Variable;
+        var v = a.expressions.get_item (0) as MathVariable;
         assert (v != null);
         var e = a.expressions.get_item (1) as MathPolynomial;
         assert (e != null);
@@ -852,7 +852,7 @@ class Tests {
         var a = eq.expressions.get_item (0) as MathAssign;
         assert (a != null);
         assert (a.expressions.get_n_items () == 2);
-        var v = a.expressions.get_item (0) as Variable;
+        var v = a.expressions.get_item (0) as MathVariable;
         assert (v != null);
         var e = a.expressions.get_item (1) as MathPolynomial;
         assert (e != null);
@@ -934,7 +934,7 @@ class Tests {
         var a = eq.expressions.get_item (0) as MathAssign;
         assert (a != null);
         assert (a.expressions.get_n_items () == 2);
-        var v = a.expressions.get_item (0) as Variable;
+        var v = a.expressions.get_item (0) as MathVariable;
         assert (v != null);
         var e = a.expressions.get_item (1) as MathPolynomial;
         assert (e != null);
@@ -952,7 +952,7 @@ class Tests {
         assert (e2.expressions.get_n_items () == 1);
         var t2 = e2.expressions.get_item (0) as MathTerm;
         assert (t2 != null);
-        var v2 = t2.expressions.get_item (0) as Variable;
+        var v2 = t2.expressions.get_item (0) as MathVariable;
         assert (v2 != null);
       } catch (GLib.Error error) {
         warning ("Error: %s", error.message);
@@ -972,7 +972,7 @@ class Tests {
         var a = eq.expressions.get_item (0) as MathAssign;
         assert (a != null);
         assert (a.expressions.get_n_items () == 2);
-        var v = a.expressions.get_item (0) as Variable;
+        var v = a.expressions.get_item (0) as MathVariable;
         assert (v != null);
         var e = a.expressions.get_item (1) as MathPolynomial;
         assert (e != null);
@@ -988,14 +988,14 @@ class Tests {
         var a2 = eq2.expressions.get_item (0) as MathAssign;
         assert (a2 != null);
         assert (a2.expressions.get_n_items () == 2);
-        var v2 = a2.expressions.get_item (0) as Variable;
+        var v2 = a2.expressions.get_item (0) as MathVariable;
         assert (v2 != null);
         var e2 = a2.expressions.get_item (1) as MathPolynomial;
         assert (e2 != null);
         assert (e2.expressions.get_n_items () == 1);
         var t2 = e2.expressions.get_item (0) as MathTerm;
         assert (t2 != null);
-        var v3 = t2.expressions.get_item (0) as Variable;
+        var v3 = t2.expressions.get_item (0) as MathVariable;
         assert (v3 != null);
       } catch (GLib.Error error) {
         warning ("Error: %s", error.message);
@@ -1017,7 +1017,7 @@ class Tests {
         var a = eq.expressions.get_item (0) as MathAssign;
         assert (a != null);
         assert (a.expressions.get_n_items () == 2);
-        var v = a.expressions.get_item (0) as Variable;
+        var v = a.expressions.get_item (0) as MathVariable;
         assert (v != null);
         var e = a.expressions.get_item (1) as MathPolynomial;
         assert (e != null);
@@ -1033,14 +1033,14 @@ class Tests {
         var a2 = eq2.expressions.get_item (0) as MathAssign;
         assert (a2 != null);
         assert (a2.expressions.get_n_items () == 2);
-        var v2 = a2.expressions.get_item (0) as Variable;
+        var v2 = a2.expressions.get_item (0) as MathVariable;
         assert (v2 != null);
         var e2 = a2.expressions.get_item (1) as MathPolynomial;
         assert (e2 != null);
         assert (e2.expressions.get_n_items () == 1);
         var t2 = e2.expressions.get_item (0) as MathTerm;
         assert (t2 != null);
-        var v3 = t2.expressions.get_item (0) as Variable;
+        var v3 = t2.expressions.get_item (0) as MathVariable;
         assert (v3 != null);
         var eq3 = eqman.equations.get_item (2) as MathEquation;
         assert (eq3 != null);
@@ -1049,7 +1049,7 @@ class Tests {
         var a3 = eq3.expressions.get_item (0) as MathAssign;
         assert (a3 != null);
         assert (a3.expressions.get_n_items () == 2);
-        var v4 = a3.expressions.get_item (0) as Variable;
+        var v4 = a3.expressions.get_item (0) as MathVariable;
         assert (v4 != null);
         var e3 = a3.expressions.get_item (1) as MathPolynomial;
         assert (e3 != null);
@@ -1058,14 +1058,14 @@ class Tests {
         var t3 = e3.expressions.get_item (0) as MathTerm;
         assert (t3 != null);
         assert (t3.expressions.get_n_items () == 1);
-        var v5 = t3.expressions.get_item (0) as Variable;
+        var v5 = t3.expressions.get_item (0) as MathVariable;
         assert (v5 != null);
         var t4 = e3.expressions.get_item (1) as MathTerm;
         assert (t4 != null);
         assert (t4.expressions.get_n_items () == 2);
         var plus = t4.expressions.get_item (0) as MathPlus;
         assert (plus != null);
-        var v6 = t4.expressions.get_item (1) as Variable;
+        var v6 = t4.expressions.get_item (1) as MathVariable;
         assert (v6 != null);
       } catch (GLib.Error error) {
         warning ("Error: %s", error.message);
@@ -1085,7 +1085,7 @@ class Tests {
         var a = eq.expressions.get_item (0) as MathAssign;
         assert (a != null);
         assert (a.expressions.get_n_items () == 2);
-        var v = a.expressions.get_item (0) as Variable;
+        var v = a.expressions.get_item (0) as MathVariable;
         assert (v != null);
         assert (v.name == "x");
         var e = a.expressions.get_item (1) as MathPolynomial;
@@ -1093,7 +1093,7 @@ class Tests {
         assert (e.expressions.get_n_items () == 1);
         var t = e.expressions.get_item (0) as MathTerm;
         assert (t != null);
-        var ev = t.expressions.get_item (0) as Variable;
+        var ev = t.expressions.get_item (0) as MathVariable;
         assert (ev != null);
         var p = ev as GCalc.MathParameter;
         assert (p != null);
@@ -1107,7 +1107,7 @@ class Tests {
         assert (e2.expressions.get_n_items () == 1);
         var t2 = e2.expressions.get_item (0) as MathTerm;
         assert (t2 != null);
-        var v2 = t2.expressions.get_item (0) as Variable;
+        var v2 = t2.expressions.get_item (0) as MathVariable;
         assert (v2 != null);
       } catch (GLib.Error error) {
         warning ("Error: %s", error.message);
diff --git a/tests/gcalc-solving-basic.vala b/tests/gcalc-solving-basic.vala
index 6d5664bf..a50f9807 100644
--- a/tests/gcalc-solving-basic.vala
+++ b/tests/gcalc-solving-basic.vala
@@ -1046,7 +1046,7 @@ class Tests {
         message ("MathConstant Result: %s", res1.to_string ());
         assert (res1.real () == 3.0);
         assert (a.expressions.get_n_items () == 2);
-        var v = a.expressions.get_item (0) as Variable;
+        var v = a.expressions.get_item (0) as MathVariable;
         assert (v != null);
         var res2 = v.evaluate () as MathConstant;
         assert (res2 != null);
@@ -1072,7 +1072,7 @@ class Tests {
         message ("MathConstant Result: %s", res1.to_string ());
         assert (res1.real () == 48.0);
         assert (a.expressions.get_n_items () == 2);
-        var v = a.expressions.get_item (0) as Variable;
+        var v = a.expressions.get_item (0) as MathVariable;
         assert (v != null);
         var res2 = v.evaluate () as MathConstant;
         assert (res2 != null);


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