## tests/pw/test_pw.c

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

## FUNCTIONS

This source file includes following functions.

1. SK_close
2. SK_puts
3. CO_get_whois_suspended
4. SK_gets
5. SQ_close_connection
6. WQ_execute_whois_query
7. CO_get_password
8. CO_get_database
9. CO_get_database_port
10. CO_get_user
11. CO_get_host
12. SQ_get_connection
13. QC_new
14. QI_execute
15. QC_free
16. QI_new
17. QI_free
18. main

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

      Example code: Unit test driver for protocol_whois.c

      Status: NOT REVIEWED, NOT TESTED

      ******************/ /******************
      Modification History:
            ottrey (09/03/1999) Created.
            ottrey (09/03/1999) Documented.
      ******************/ /******************
      Copyright (c) 1993, 1994, 1995, 1996, 1997  The TERENA Association
      Copyright (c) 1998                              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.
      ***************************************/
    #define UNIT_TEST
    #include "../test_.c" /* unit test template */

    #define TEST1 "1 General test"

    /* Global Default to get the input from stdin */
    FILE *infile = stdin;

    SK_close() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to SK_close()\n");
    } /* SK_close() */

    SK_puts() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to SK_puts()\n");
    } /* SK_puts() */

    int CO_get_whois_suspended() {
    /* [<][>][^][v][top][bottom][index][help] */
      return 0;
    } /* CO_get_whois_suspended() */

    int SK_gets(int sock, char *input, int size) {
    /* [<][>][^][v][top][bottom][index][help] */
      int input_len;

      fgets(input, size, infile);
      input_len = strlen(input);
      if (input[input_len-1] == '\n') {
        input[input_len-1] = '\0';
      }

      if (Verbose == 1) {
        printf("input=%s\n", input);
      }

      return 1;
    } /* SK_gets() */

    SQ_close_connection() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to SQ_close_connection()\n");
    } /* SQ_close_connection() */

    WQ_execute_whois_query() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to WQ_execute_whois_query()\n");
    } /* WQ_execute_whois_query() */

    char *CO_get_password() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to CO_get_password()\n");
    } /* CO_get_password() */

    CO_get_database() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to CO_get_database()\n");
    } /* CO_get_database() */

    CO_get_database_port() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to CO_get_database_port()\n");
    } /* CO_get_database_port() */

    CO_get_user() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to CO_get_user()\n");
    } /* CO_get_user() */

    CO_get_host() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to CO_get_host()\n");
    } /* CO_get_host() */

    SQ_get_connection() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to SQ_get_connection()\n");
    } /* SQ_get_connection() */

    QC_new() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to QC_new()\n");
    } /* QC_new() */

    QI_execute() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to QI_execute()\n");
    } /* QI_execute() */

    QC_free() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to QC_free()\n");
    } /* QC_free() */

    QI_new() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to QI_new()\n");
    } /* QI_new() */

    QI_free() {
    /* [<][>][^][v][top][bottom][index][help] */
      printf("call to QI_free()\n");
    } /* QI_free() */

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

      char input[STR_L];

      char  *str;

      /* Get the options from the command line */
      get_options(argc, argv);

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

        /* Open infile */
        if (Infile_name != NULL) {
          infile = fopen(Infile_name, "r");

          if (infile == NULL) {
            perror("Couldn't load infile");
            return -1;
          }
        }

        PW_interact(1);

      } /* TEST1 */

      return(0);

    } /* main() */

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