Changeset 122

Show
Ignore:
Timestamp:
03/22/07 03:29:00
Author:
kunxi
Message:

Remove unnecessary test cases for io_fread_local_async and io_fwrite_local_async
The return result of wrong argument is not covered in the spec:

do local aync operation on COMMON_FP
do read operation on UPC_WRONLY
do write operation on UPC_RDONLY
so just ignore them.


Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/io_fread_local_async.upc

    r74 r122  
    7575        nmemb = BUFLEN / (MYTHREAD + 1); 
    7676        buffer = (void*) pd; 
     77        size = sizeof(char); 
    7778         
    7879 
     
    8182                size = sizeof(int); 
    8283        } 
     84        upc_barrier; 
    8385 
    8486        fd = upc_all_fopen( fname,  
     
    9496        /* Now, we are going to launch upc_fread */ 
    9597        upc_all_fread_local_async(fd, buffer, size, nmemb, sync); 
    96         upc_barrier; 
    97          
    9898        ret = upc_all_fwait_async(fd); 
     99 
    99100        if( ret == -1 ){ 
    100101                GULA_FAIL("failed on fwait_async"); 
     
    114115        upc_barrier; 
    115116 
    116 /* To check that this function only works for individual file pointer */ 
    117          
    118         fd = upc_all_fopen( fname,  
    119                 UPC_RDONLY | UPC_COMMON_FP, 0, NULL); 
    120         if( fd == NULL ) 
    121                 GULA_FAIL("failed to open the file"); 
     117        /*  
     118         * To check that this function only works for individual file pointer  
     119         * This test is intentially deleted since the spec does not specify the behavior  
     120         */ 
    122121 
    123         upc_barrier; 
    124  
    125         ret = upc_all_fwait_async(fd); 
    126         if( ret != -1 ) 
    127                 GULA_FAIL("failed to return an error while COMMON_FP is used with this function"); 
    128         upc_barrier; 
    129  
    130         if( upc_all_fclose(fd) != 0 ) 
    131                 GULA_FAIL("failed to close the file"); 
    132          
    133         upc_barrier;     
    134  
    135 /* To check that this function only works for the file handle that is open for reading */ 
    136         fd = upc_all_fopen( fname,  
    137                 UPC_WRONLY | UPC_COMMON_FP, 0, NULL); 
    138         if( fd == NULL ) 
    139                 GULA_FAIL("failed to open the file"); 
    140  
    141         upc_barrier; 
    142  
    143         /* Now, we are going to launch upc_fread */ 
    144         upc_all_fread_local_async(fd, NULL, 1, 0, sync); 
    145         upc_barrier; 
    146          
    147         ret = upc_all_fwait_async(fd); 
    148         if( ret != -1 ) 
    149                 GULA_FAIL("failed to return an error while an attempt to read from a WRONLY file "); 
    150         upc_barrier; 
    151  
    152         if( upc_all_fclose(fd) != 0 ) 
    153                 GULA_FAIL("failed to close the file"); 
    154          
    155         upc_barrier; 
    156  
     122        /* To check that this function only works for the file handle that is open for reading  
     123         * This test is intentially deleted since the spec does not specify the behavior */ 
    157124        return 0; 
    158125}  
  • src/io_fwrite_local_async.upc

    r72 r122  
    167167        } 
    168168 
    169         /* To check that this function only works for individual file pointer */ 
    170         fd = upc_all_fopen( fname, 
    171                         UPC_RDWR | UPC_CREATE | UPC_TRUNC | UPC_COMMON_FP, 1, &hints); 
    172         if( fd == NULL ) 
    173                 GULA_FAIL("failed to create the file"); 
     169        /*  
     170         * To check that this function only works for individual file pointer  
     171         * This test is intentially deleted since the spec does not specify the behavior  
     172         */ 
    174173 
    175         /* dummy write */ 
    176         upc_all_fwrite_local(fd, NULL, 1, 0, sync); 
    177         upc_barrier; 
    178          
    179         ret = upc_all_fwait_async(fd); 
    180         if( ret != -1 ) 
    181                 GULA_FAIL("failed to prevent write on COMMON_FP");       
    182          
    183174        if( upc_all_fclose(fd) != 0 ) 
    184175                GULA_FAIL("failed to close the file");