tests/co/test_co.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following functions.
  1. PR_get_property
  2. main

   1 /***************************************
   2   $Revision: 1.2 $
   3 
   4   Example code: Unit test driver for constants.c
   5 
   6   ******************/ /******************
   7   Modification History:
   8         ottrey (30/03/1999) Created.
   9   ******************/ /******************
  10   Copyright (c) 1999                              RIPE NCC
  11  
  12   All Rights Reserved
  13   
  14   Permission to use, copy, modify, and distribute this software and its
  15   documentation for any purpose and without fee is hereby granted,
  16   provided that the above copyright notice appear in all copies and that
  17   both that copyright notice and this permission notice appear in
  18   supporting documentation, and that the name of the author not be
  19   used in advertising or publicity pertaining to distribution of the
  20   software without specific, written prior permission.
  21   
  22   THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  23   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
  24   AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
  25   DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
  26   AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  27   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  28   ***************************************/
  29 
  30 /* Stub declarations */
  31 char *PR_get_property(char *token, char *default_value);
  32 
  33 #include "../test_.c"     /* The unit test template */
  34 
  35 #include "constants.h"
  36 
  37 #define TEST1 "1 CO_to_string()"
  38 #define TEST2 "2 CO_get_whois_port"
  39 #define TEST3 "3 CO_get_user()"
  40 
  41 /* PR_get_property() */
  42 /*++++++++++++++++++++++++++++++++++++++
  43 
  44   Used in constants unit test driver.
  45 
  46   More:
  47   +html+ <PRE>
  48   Authors:
  49         ottrey
  50   +html+ </PRE><DL COMPACT>
  51 
  52   ++++++++++++++++++++++++++++++++++++++*/
  53 char *PR_get_property(char *token, char *default_value) {
     /* [<][>][^][v][top][bottom][index][help] */
  54 
  55   return default_value;
  56 
  57 } /* PR_get_property() */
  58 
  59 
  60 int main(int argc, char** argv) {
     /* [<][>][^][v][top][bottom][index][help] */
  61 
  62   char *str;
  63 
  64   /* Get options */
  65   get_options(argc, argv);
  66 
  67   Infile_name = "";
  68 
  69   printf("here0\n");
  70 
  71   /* Set the constants */
  72   CO_set();
  73 
  74   printf("here1\n");
  75 
  76   /* TEST1 */
  77   if(Test[1] == 1) {
  78     print_title(TEST1);
  79 
  80     str = CO_to_string();
  81     printf("%s\n", str);
  82     free(str);
  83   } /* TEST1 */
  84 
  85   /* TEST2 */
  86   if(Test[2] == 1) {
  87     print_title(TEST2);
  88     
  89     printf("SV.whois_port=%s\n", CO_get_whois_port());
  90   } /* TEST2 */
  91 
  92   /* TEST3 */
  93   if(Test[3] == 1) {
  94     print_title(TEST3);
  95     
  96     printf("DB.user=%s\n", CO_get_user());
  97   } /* TEST3 */
  98 
  99   return(0);
 100 
 101 } /* main() */
 102 

/* [<][>][^][v][top][bottom][index][help] */