IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5222


Ignore:
Timestamp:
Oct 3, 2005, 3:31:40 PM (21 years ago)
Author:
drobbin
Message:

Added testing for psArgument functions and updated some psTime (minor changes).

Location:
trunk/psLib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/pslib.kdevelop

    r5216 r5222  
    1414    <projectdirectory>.</projectdirectory>
    1515    <absoluteprojectpath>false</absoluteprojectpath>
    16     <description></description>
     16    <description/>
    1717    <secondaryLanguages/>
    1818  </general>
     
    4949        <envvar value="1" name="WANT_AUTOMAKE_1_6" />
    5050      </envvars>
    51       <abortonerror>false</abortonerror>
    52       <numberofjobs>3</numberofjobs>
    53       <dontact>false</dontact>
    54       <makebin></makebin>
    55       <prio>0</prio>
    5651    </make>
    5752  </kdevautoproject>
     
    174169  <kdevdebugger>
    175170    <general>
    176       <programargs></programargs>
    177       <gdbpath></gdbpath>
     171      <programargs/>
     172      <gdbpath/>
    178173      <dbgshell>libtool</dbgshell>
    179       <configGdbScript></configGdbScript>
    180       <runShellScript></runShellScript>
    181       <runGdbScript></runGdbScript>
     174      <configGdbScript/>
     175      <runShellScript/>
     176      <runGdbScript/>
    182177      <breakonloadinglibs>true</breakonloadinglibs>
    183178      <separatetty>false</separatetty>
  • trunk/psLib/src/astro/psTime.c

    r5136 r5222  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-09-26 21:13:12 $
     12 *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-10-04 01:31:40 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    486486
    487487    // Get the system time
    488     if (gettimeofday(&now, (struct timezone *)0) == -1) {
     488    //    if (gettimeofday(&now, (struct timezone *)0) == -1) {
     489    if (gettimeofday(&now, 0) == -1) {
    489490        psError(PS_ERR_OS_CALL_FAILED, true,
    490491                PS_ERRORTEXT_psTime_GET_TOD_FAILED);
  • trunk/psLib/src/mathtypes/psVector.c

    r5213 r5222  
    99*  @author Robert DeSonia, MHPCC
    1010*
    11 *  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2005-09-30 23:09:13 $
     11*  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2005-10-04 01:31:40 $
    1313*
    1414*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1919#include <stdio.h>
    2020#include <math.h>
     21#include <unistd.h>
    2122
    2223#include "psMemory.h"
     
    603604                      char *name)
    604605{
    605     /*
    606         XXXX: This is seg faulting.  So I'm getting rid of it.
    607         FILE *f;
    608         f = fdopen(fd, "a+");
    609         fprintf (f, "vector: %s\n", name);
    610 
    611         for (int i = 0; i < a[0].n; i++) {
    612             fprintf (f, "%f\n", p_psVectorGetElementF64(a, i));
    613         }
    614         fprintf (f, "\n");
    615     // XXXX: temp fix: this should be recoded.
    616     //    fclose(f);
    617         return (true);
    618     */
    619 
    620     printf ("vector: %s\n", name);
     606    char line[1024];
     607
     608    sprintf (line, "vector: %s\n", name);
     609    write (fd, line, strlen(line));
     610
    621611    for (int i = 0; i < a[0].n; i++) {
    622         printf("%f\n", p_psVectorGetElementF64(a, i));
    623     }
    624     printf("\n");
    625     fflush(stdout);
     612        sprintf (line, "%f\n", p_psVectorGetElementF64(a, i));
     613        write (fd, line, strlen(line));
     614    }
     615    sprintf (line, "\n");
     616    write (fd, line, strlen(line));
    626617    return (true);
    627618}
  • trunk/psLib/test/types/tst_psMetadata_07.c

    r5203 r5222  
    1414*  @author  David Robbins, MHPCC
    1515*
    16 *  @version $Revision: 1.10 $  $Name: not supported by cvs2svn $
    17 *  @date  $Date: 2005-09-30 01:34:45 $
     16*  @version $Revision: 1.11 $  $Name: not supported by cvs2svn $
     17*  @date  $Date: 2005-10-04 01:31:40 $
    1818*
    1919*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2929static psS32 testMetaRemove(void);
    3030static psS32 testMetaAddPtr(void);
     31static psS32 testArgument(void);
    3132
    3233testDescription tests[] = {
     
    3536                              {testMetaRemove, 0, "Test psMetadataRemoveKey/Index", 0, false},
    3637                              {testMetaAddPtr, 0, "Test psMetadataAddPtr", 0, false},
     38                              {testArgument, 0, "Test psArgument fxns", 0, false},
    3739                              {NULL}
    3840                          };
     
    221223
    222224}
     225
     226psS32 testArgument(void)
     227{
     228    char *argv[6];
     229    argv[0] = "./program";
     230    argv[1] = "-string";
     231    argv[2] = "new";
     232    argv[3] = "-float";
     233    argv[4] = "6.66";
     234    argv[5] = "-vvv";
     235    int argc = 6;
     236
     237    int i = psArgumentGet(argc, argv, "-float");
     238    if ( i != 0 ) {
     239        if ( !psArgumentRemove(i, &argc, argv) ) {
     240            printf("\n Failed to remove string from argument list\n");
     241        }
     242    } else {
     243        printf("\nFailed to find string in argument list\n");
     244    }
     245    psArgumentRemove(i, &argc, argv);
     246    printf("\n Argument %d has been removed", i);
     247    int log = psArgumentVerbosity(&argc, argv);
     248    printf("\nLog level = %d \n", log);
     249
     250    psMetadata *args = psMetadataAlloc();
     251    psMetadataAdd(args, PS_LIST_TAIL, "-string", PS_DATA_STRING, "Test String", "SomeString");
     252    psMetadataAdd(args, PS_LIST_TAIL, "-int", PS_DATA_S32 | PS_META_DUPLICATE_OK, "Int1", 1);
     253    psMetadataAdd(args, PS_LIST_TAIL, "-int", PS_DATA_S32 | PS_META_DUPLICATE_OK, "Int2", 2);
     254    psMetadataAdd(args, PS_LIST_TAIL, "-float", PS_DATA_F32, "Test Float", 6);
     255
     256    if ( !psArgumentParse(args, &argc, argv) || argc != 1 ) {
     257        psArgumentHelp(args);
     258        psFree(args);
     259        return 0;
     260    }
     261
     262    psMetadataPrint(args, 4);
     263
     264    psFree(args);
     265    return 0;
     266}
     267
  • trunk/psLib/test/types/verified/tst_psMetadata_07.stdout

    r4870 r5222  
    4444---> TESTPOINT PASSED (psMetadata{Test E - psMetadataConfigWrite} | tst_psMetadata_07.c)
    4545
     46
     47 Argument 3 has been removed
     48Log level = 5
     49Updating -string
     50    -string (Test String): new
     51    -int (Int1): 1
     52    -int (Int2): 2
     53    -float (Test Float): 0.000000
Note: See TracChangeset for help on using the changeset viewer.