|
1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 #undef G_DISABLE_ASSERT |
|
18 #undef G_LOG_DOMAIN |
|
19 |
|
20 #include<stdio.h> |
|
21 #include "glib.h" |
|
22 #define LOG_FILE "c:\\logs\\majorversion_test_log.txt" |
|
23 #include "std_log_result.h" |
|
24 #define LOG_FILENAME_LINE __FILE__, __LINE__ |
|
25 |
|
26 void create_xml(int result) |
|
27 { |
|
28 if(result) |
|
29 assert_failed = 1; |
|
30 |
|
31 testResultXml("version-test"); |
|
32 close_log_file(); |
|
33 } |
|
34 |
|
35 |
|
36 int |
|
37 main (int argc, |
|
38 char *argv[]) |
|
39 { |
|
40 const guint *major_version = NULL; |
|
41 const guint *minor_version = NULL; |
|
42 const guint *micro_version = NULL; |
|
43 const guint *interface_age = NULL; |
|
44 const guint *binary_age = NULL; |
|
45 const gchar *check_version = NULL; |
|
46 major_version = _glib_major_version(); |
|
47 minor_version = _glib_minor_version(); |
|
48 micro_version = _glib_micro_version(); |
|
49 interface_age = _glib_interface_age(); |
|
50 binary_age = _glib_binary_age(); |
|
51 std_log(LOG_FILENAME_LINE,"Binary age :%d\n Interface age:%d",*binary_age,*interface_age); |
|
52 check_version = glib_check_version((*major_version),(*minor_version),(*micro_version)); |
|
53 if(check_version != NULL) |
|
54 { |
|
55 std_log(LOG_FILENAME_LINE,"GLib library in use is not compatible with the given verison"); |
|
56 assert_failed = 1; |
|
57 } |
|
58 if(assert_failed) |
|
59 { |
|
60 std_log(LOG_FILENAME_LINE,"%s",check_version); |
|
61 std_log(LOG_FILENAME_LINE,"Test Fail"); |
|
62 } |
|
63 else |
|
64 std_log(LOG_FILENAME_LINE,"Test Successful"); |
|
65 |
|
66 |
|
67 create_xml(assert_failed); |
|
68 return 0; |
|
69 } |
|
70 |
|
71 |