[gimp/gimp-2-10] tests: fix clang compilation error on test-eevl.c
- From: Alex Samorukov <asamorukov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] tests: fix clang compilation error on test-eevl.c
- Date: Fri, 23 Nov 2018 21:35:54 +0000 (UTC)
commit 40a08dcf48981d84a6d44807bc721dc121bec99b
Author: Oleksii Samorukov <samm os2 kiev ua>
Date: Fri Nov 23 22:32:32 2018 +0100
tests: fix clang compilation error on test-eevl.c
libgimpwidgets/test-eevl.c | 71 +++++++++++++++++++++++-----------------------
1 file changed, 35 insertions(+), 36 deletions(-)
---
diff --git a/libgimpwidgets/test-eevl.c b/libgimpwidgets/test-eevl.c
index 1d0a5e3b6b..fb3a40ce0e 100644
--- a/libgimpwidgets/test-eevl.c
+++ b/libgimpwidgets/test-eevl.c
@@ -40,42 +40,6 @@ typedef struct
gboolean should_succeed;
} TestCase;
-static TestCase cases[] =
-{
- /* "Default" test case */
- { "2in + 3in", { 2 + 3, 1}, TRUE },
-
- /* Whitespace variations */
- { "2in+3in", { 2 + 3, 1}, TRUE },
- { " 2in + 3in", { 2 + 3, 1}, TRUE },
- { "2in + 3in ", { 2 + 3, 1}, TRUE },
- { "2 in + 3 in", { 2 + 3, 1}, TRUE },
- { " 2 in + 3 in ", { 2 + 3, 1}, TRUE },
-
- /* Make sure the default unit is applied as it should */
- { "2 + 3in", { 2 + 3, 1 }, TRUE },
- { "3", { 3, 1 }, TRUE },
-
- /* Somewhat complicated input */
- { "(2 + 3)in", { 2 + 3, 1}, TRUE },
-// { "2 / 3 in", { 2 / 3., 1}, TRUE },
- { "(2 + 2/3)in", { 2 + 2 / 3., 1}, TRUE },
- { "1/2 + 1/2", { 1, 1}, TRUE },
- { "2 ^ 3 ^ 4", { pow (2, pow (3, 4)), 1}, TRUE },
-
- /* Mixing of units */
- { "2mm + 3in", { 2 / 25.4 + 3, 1}, TRUE },
-
- /* 'odd' behavior */
- { "2 ++ 1", { 3, 1}, TRUE },
- { "2 +- 1", { 1, 1}, TRUE },
- { "2 -- 1", { 3, 1}, TRUE },
-
- /* End of test cases */
- { NULL, { 0, 0 }, TRUE }
-};
-
-
static gboolean
test_units (const gchar *ident,
GimpEevlQuantity *result,
@@ -111,6 +75,41 @@ main(void)
gint failed = 0;
gint succeeded = 0;
+ TestCase cases[] =
+ {
+ /* "Default" test case */
+ { "2in + 3in", { 2 + 3, 1}, TRUE },
+
+ /* Whitespace variations */
+ { "2in+3in", { 2 + 3, 1}, TRUE },
+ { " 2in + 3in", { 2 + 3, 1}, TRUE },
+ { "2in + 3in ", { 2 + 3, 1}, TRUE },
+ { "2 in + 3 in", { 2 + 3, 1}, TRUE },
+ { " 2 in + 3 in ", { 2 + 3, 1}, TRUE },
+
+ /* Make sure the default unit is applied as it should */
+ { "2 + 3in", { 2 + 3, 1 }, TRUE },
+ { "3", { 3, 1 }, TRUE },
+
+ /* Somewhat complicated input */
+ { "(2 + 3)in", { 2 + 3, 1}, TRUE },
+ // { "2 / 3 in", { 2 / 3., 1}, TRUE },
+ { "(2 + 2/3)in", { 2 + 2 / 3., 1}, TRUE },
+ { "1/2 + 1/2", { 1, 1}, TRUE },
+ { "2 ^ 3 ^ 4", { pow (2, pow (3, 4)), 1}, TRUE },
+
+ /* Mixing of units */
+ { "2mm + 3in", { 2 / 25.4 + 3, 1}, TRUE },
+
+ /* 'odd' behavior */
+ { "2 ++ 1", { 3, 1}, TRUE },
+ { "2 +- 1", { 1, 1}, TRUE },
+ { "2 -- 1", { 3, 1}, TRUE },
+
+ /* End of test cases */
+ { NULL, { 0, 0 }, TRUE }
+ };
+
g_print ("Testing Eevl Eva, the Evaluator\n\n");
for (i = 0; cases[i].string; i++)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]