security/nss/lib/freebl/mpi/tests/mptest-1.c

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/lib/freebl/mpi/tests/mptest-1.c	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +/*
     1.5 + * Simple test driver for MPI library
     1.6 + *
     1.7 + * Test 1: Simple input test (drives single-digit multiply and add,
     1.8 + *         as well as I/O routines)
     1.9 + *
    1.10 + * This Source Code Form is subject to the terms of the Mozilla Public
    1.11 + * License, v. 2.0. If a copy of the MPL was not distributed with this
    1.12 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    1.13 +
    1.14 +#include <stdio.h>
    1.15 +#include <stdlib.h>
    1.16 +#include <string.h>
    1.17 +#include <ctype.h>
    1.18 +#include <limits.h>
    1.19 +
    1.20 +#ifdef MAC_CW_SIOUX
    1.21 +#include <console.h>
    1.22 +#endif
    1.23 +
    1.24 +#include "mpi.h"
    1.25 +
    1.26 +int main(int argc, char *argv[])
    1.27 +{
    1.28 +  int    ix;
    1.29 +  mp_int mp;
    1.30 +
    1.31 +#ifdef MAC_CW_SIOUX
    1.32 +  argc = ccommand(&argv);
    1.33 +#endif
    1.34 +
    1.35 +  mp_init(&mp);
    1.36 +  
    1.37 +  for(ix = 1; ix < argc; ix++) {
    1.38 +    mp_read_radix(&mp, argv[ix], 10);
    1.39 +    mp_print(&mp, stdout);
    1.40 +    fputc('\n', stdout);
    1.41 +  }
    1.42 +
    1.43 +  mp_clear(&mp);
    1.44 +  return 0;
    1.45 +}

mercurial