genericopenlibs/liboil/tsrc/testsuite/debug/src/debug.c
changeset 59 09fa7c3c5079
equal deleted inserted replaced
52:bf6a71c50e42 59:09fa7c3c5079
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <liboil/liboil.h>
       
    20 #include <liboil/liboildebug.h>
       
    21 #include <liboil/liboilfunction.h>
       
    22 #include <stdio.h>
       
    23 #include <stdlib.h>
       
    24 
       
    25 #include <liboil/globals.h>
       
    26 
       
    27 #define LOG_FILE "c:\\logs\\testsuite_debug_log.txt"
       
    28 #include "std_log_result.h"
       
    29 #define LOG_FILENAME_LINE __FILE__, __LINE__
       
    30 
       
    31 void create_xml(int result)
       
    32 {
       
    33     if(result)
       
    34         assert_failed = 1;
       
    35     
       
    36     testResultXml("testsuite_debug");
       
    37     close_log_file();
       
    38 }
       
    39 
       
    40 void test()
       
    41     {
       
    42     int level = 2;
       
    43     int ret;
       
    44     
       
    45     oil_debug_set_level(level);
       
    46     ret = oil_debug_get_level();
       
    47     
       
    48     if(ret != level)
       
    49         {
       
    50         std_log(LOG_FILENAME_LINE,"oil_debug_get/set method failed. errno = %d", errno);
       
    51         assert_failed = 1;
       
    52         }
       
    53     }
       
    54 
       
    55 int main (int argc, char *argv[])
       
    56 {
       
    57     oil_init ();
       
    58 
       
    59     test();
       
    60     
       
    61     if(assert_failed)
       
    62       std_log(LOG_FILENAME_LINE,"Test Failed");
       
    63     else
       
    64       std_log(LOG_FILENAME_LINE,"Test Successful");
       
    65     
       
    66     create_xml(0);
       
    67     return 0;
       
    68 }
       
    69