[gtk/constraint-guide-3] Amend a constraint solver test
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/constraint-guide-3] Amend a constraint solver test
- Date: Fri, 28 Jun 2019 17:11:55 +0000 (UTC)
commit ad087634fd75c94a1686644f65ae76ca9dfd0abc
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jun 28 16:30:07 2019 +0000
Amend a constraint solver test
Make the 'repeat edit' test make more than to
suggestions in a single edit phase. It turns out
that this does not work, whereas just doing
two in a row does.
testsuite/gtk/constraint-solver.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/testsuite/gtk/constraint-solver.c b/testsuite/gtk/constraint-solver.c
index f09decbaa9..54fc39d1c3 100644
--- a/testsuite/gtk/constraint-solver.c
+++ b/testsuite/gtk/constraint-solver.c
@@ -254,15 +254,27 @@ constraint_solver_edit_var_suggest (void)
gtk_constraint_solver_suggest_value (solver, a, 2.0);
gtk_constraint_solver_resolve (solver);
+ g_test_message ("Check values after first edit");
+
g_assert_cmpfloat_with_epsilon (gtk_constraint_variable_get_value (a), 2.0, 0.001);
g_assert_cmpfloat_with_epsilon (gtk_constraint_variable_get_value (b), 2.0, 0.001);
gtk_constraint_solver_suggest_value (solver, a, 10.0);
gtk_constraint_solver_resolve (solver);
+ g_test_message ("Check values after second edit");
+
g_assert_cmpfloat_with_epsilon (gtk_constraint_variable_get_value (a), 10.0, 0.001);
g_assert_cmpfloat_with_epsilon (gtk_constraint_variable_get_value (b), 10.0, 0.001);
+ gtk_constraint_solver_suggest_value (solver, a, 12.0);
+ gtk_constraint_solver_resolve (solver);
+
+ g_test_message ("Check values after third edit");
+
+ g_assert_cmpfloat_with_epsilon (gtk_constraint_variable_get_value (a), 12.0, 0.001);
+ g_assert_cmpfloat_with_epsilon (gtk_constraint_variable_get_value (b), 12.0, 0.001);
+
gtk_constraint_variable_unref (a);
gtk_constraint_variable_unref (b);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]