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