| 1 | /* |
| 2 | * Copyright (C) 2012 Igalia S.L. |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2,1 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Library General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Library General Public License |
| 15 | * along with this library; see the file COPYING.LIB. If not, write to |
| 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 | * Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | #include "config.h" |
| 21 | |
| 22 | #include "TestMain.h" |
| 23 | #include <gtk/gtk.h> |
| 24 | #include <webkit2/webkit2.h> |
| 25 | |
| 26 | |
| 27 | static void testWebKitVersion(Test*, gconstpointer) |
| 28 | { |
| 29 | g_assert_cmpuint(webkit_get_major_version(), ==, WEBKIT_MAJOR_VERSION); |
| 30 | g_assert_cmpuint(webkit_get_minor_version(), ==, WEBKIT_MINOR_VERSION); |
| 31 | g_assert_cmpuint(webkit_get_micro_version(), ==, WEBKIT_MICRO_VERSION); |
| 32 | } |
| 33 | |
| 34 | static void testWebKitCheckVersion(Test*, gconstpointer) |
| 35 | { |
| 36 | g_assert_true(WEBKIT_CHECK_VERSION(WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION)); |
| 37 | g_assert_false(WEBKIT_CHECK_VERSION(WEBKIT_MAJOR_VERSION + 1, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION)); |
| 38 | g_assert_false(WEBKIT_CHECK_VERSION(WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION + 1, WEBKIT_MICRO_VERSION)); |
| 39 | g_assert_false(WEBKIT_CHECK_VERSION(WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION + 1)); |
| 40 | } |
| 41 | |
| 42 | void beforeAll() |
| 43 | { |
| 44 | Test::add("WebKitVersion" , "version" , testWebKitVersion); |
| 45 | Test::add("WebKitVersion" , "check-version" , testWebKitCheckVersion); |
| 46 | } |
| 47 | |
| 48 | void afterAll() |
| 49 | { |
| 50 | } |
| 51 | |