## tests/co/test_co.c

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

## FUNCTIONS

This source file includes following functions.

1. PR_get_property
2. main

    /***************************************
      $Revision: 1.2 $

      Example code: Unit test driver for constants.c

      ******************/ /******************
      Modification History:
            ottrey (30/03/1999) Created.
      ******************/ /******************
      Copyright (c) 1999                              RIPE NCC

      All Rights Reserved

      Permission to use, copy, modify, and distribute this software and its
      documentation for any purpose and without fee is hereby granted,
      provided that the above copyright notice appear in all copies and that
      both that copyright notice and this permission notice appear in
      supporting documentation, and that the name of the author not be
      used in advertising or publicity pertaining to distribution of the
      software without specific, written prior permission.

      THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
      ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
      AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
      DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
      AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
      OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
      ***************************************/

    /* Stub declarations */
    char *PR_get_property(char *token, char *default_value);

    #include "../test_.c"     /* The unit test template */

    #include "constants.h"

    #define TEST1 "1 CO_to_string()"
    #define TEST2 "2 CO_get_whois_port"
    #define TEST3 "3 CO_get_user()"

    /* PR_get_property() */
    /*++++++++++++++++++++++++++++++++++++++

      Used in constants unit test driver.

      More:
      +html+ <PRE>
      Authors:
            ottrey
      +html+ </PRE><DL COMPACT>

      ++++++++++++++++++++++++++++++++++++++*/
    char *PR_get_property(char *token, char *default_value) {
    /* [<][>][^][v][top][bottom][index][help] */

      return default_value;

    } /* PR_get_property() */

    int main(int argc, char** argv) {
    /* [<][>][^][v][top][bottom][index][help] */

      char *str;

      /* Get options */
      get_options(argc, argv);

      Infile_name = "";

      printf("here0\n");

      /* Set the constants */
      CO_set();

      printf("here1\n");

      /* TEST1 */
      if(Test[1] == 1) {
        print_title(TEST1);

        str = CO_to_string();
        printf("%s\n", str);
        free(str);
      } /* TEST1 */

      /* TEST2 */
      if(Test[2] == 1) {
        print_title(TEST2);

        printf("SV.whois_port=%s\n", CO_get_whois_port());
      } /* TEST2 */

      /* TEST3 */
      if(Test[3] == 1) {
        print_title(TEST3);

        printf("DB.user=%s\n", CO_get_user());
      } /* TEST3 */

      return(0);

    } /* main() */

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