Commit bb2320dfa7caef01cb2fec1490f5eb750dc264ff
1 parent
d2906685
use system() function with return value
Showing
1 changed file
with
15 additions
and
14 deletions
test/test_GFits.cpp
| ... | ... | @@ -61,10 +61,11 @@ void test_create(void) |
| 61 | 61 | std::cout << "Test GFits: "; |
| 62 | 62 | |
| 63 | 63 | // Remove FITS file |
| 64 | - system("rm -rf test_empty.fits"); | |
| 65 | - system("rm -rf test_empty_image.fits"); | |
| 66 | - system("rm -rf test.fits"); | |
| 67 | - system("rm -rf test_create_bintable.fits"); | |
| 64 | + int rc = 0; | |
| 65 | + rc = system("rm -rf test_empty.fits"); | |
| 66 | + rc = system("rm -rf test_empty_image.fits"); | |
| 67 | + rc = system("rm -rf test.fits"); | |
| 68 | + rc = system("rm -rf test_create_bintable.fits"); | |
| 68 | 69 | |
| 69 | 70 | // Create empty FITS file |
| 70 | 71 | try { |
| ... | ... | @@ -1851,7 +1852,7 @@ void test_bintable_double(void) |
| 1851 | 1852 | |
| 1852 | 1853 | // Remove FITS file |
| 1853 | 1854 | std::string cmd = "rm -rf "+ filename; |
| 1854 | - system(cmd.c_str()); | |
| 1855 | + int rc = system(cmd.c_str()); | |
| 1855 | 1856 | |
| 1856 | 1857 | // Allocate reference sums |
| 1857 | 1858 | double sum_dbl = 0.0; |
| ... | ... | @@ -2208,7 +2209,7 @@ void test_bintable_float(void) |
| 2208 | 2209 | |
| 2209 | 2210 | // Remove FITS file |
| 2210 | 2211 | std::string cmd = "rm -rf "+ filename; |
| 2211 | - system(cmd.c_str()); | |
| 2212 | + int rc = system(cmd.c_str()); | |
| 2212 | 2213 | |
| 2213 | 2214 | // Allocate reference sums |
| 2214 | 2215 | float sum_flt = 0.0; |
| ... | ... | @@ -2565,7 +2566,7 @@ void test_bintable_short(void) |
| 2565 | 2566 | |
| 2566 | 2567 | // Remove FITS file |
| 2567 | 2568 | std::string cmd = "rm -rf "+ filename; |
| 2568 | - system(cmd.c_str()); | |
| 2569 | + int rc = system(cmd.c_str()); | |
| 2569 | 2570 | |
| 2570 | 2571 | // Allocate reference sums |
| 2571 | 2572 | short sum_sht = 0; |
| ... | ... | @@ -2925,7 +2926,7 @@ void test_bintable_ushort(void) |
| 2925 | 2926 | |
| 2926 | 2927 | // Remove FITS file |
| 2927 | 2928 | std::string cmd = "rm -rf "+ filename; |
| 2928 | - system(cmd.c_str()); | |
| 2929 | + int rc = system(cmd.c_str()); | |
| 2929 | 2930 | |
| 2930 | 2931 | // Allocate reference sums |
| 2931 | 2932 | unsigned short sum_sht = 0; |
| ... | ... | @@ -3285,7 +3286,7 @@ void test_bintable_long(void) |
| 3285 | 3286 | |
| 3286 | 3287 | // Remove FITS file |
| 3287 | 3288 | std::string cmd = "rm -rf "+ filename; |
| 3288 | - system(cmd.c_str()); | |
| 3289 | + int rc = system(cmd.c_str()); | |
| 3289 | 3290 | |
| 3290 | 3291 | // Allocate reference sums |
| 3291 | 3292 | long sum_lng = 0; |
| ... | ... | @@ -3644,7 +3645,7 @@ void test_bintable_longlong(void) |
| 3644 | 3645 | |
| 3645 | 3646 | // Remove FITS file |
| 3646 | 3647 | std::string cmd = "rm -rf "+ filename; |
| 3647 | - system(cmd.c_str()); | |
| 3648 | + int rc = system(cmd.c_str()); | |
| 3648 | 3649 | |
| 3649 | 3650 | // Allocate reference sums |
| 3650 | 3651 | long long sum_lng = 0; |
| ... | ... | @@ -4003,7 +4004,7 @@ void test_bintable_ulong(void) |
| 4003 | 4004 | |
| 4004 | 4005 | // Remove FITS file |
| 4005 | 4006 | std::string cmd = "rm -rf "+ filename; |
| 4006 | - system(cmd.c_str()); | |
| 4007 | + int rc = system(cmd.c_str()); | |
| 4007 | 4008 | |
| 4008 | 4009 | // Allocate reference sums |
| 4009 | 4010 | unsigned long sum_lng = 0; |
| ... | ... | @@ -4362,7 +4363,7 @@ void test_bintable_string(void) |
| 4362 | 4363 | |
| 4363 | 4364 | // Remove FITS file |
| 4364 | 4365 | std::string cmd = "rm -rf "+ filename; |
| 4365 | - system(cmd.c_str()); | |
| 4366 | + int rc = system(cmd.c_str()); | |
| 4366 | 4367 | |
| 4367 | 4368 | // Allocate reference sums |
| 4368 | 4369 | std::string sum_str; |
| ... | ... | @@ -4720,7 +4721,7 @@ void test_bintable_logical(void) |
| 4720 | 4721 | |
| 4721 | 4722 | // Remove FITS file |
| 4722 | 4723 | std::string cmd = "rm -rf "+ filename; |
| 4723 | - system(cmd.c_str()); | |
| 4724 | + int rc = system(cmd.c_str()); | |
| 4724 | 4725 | |
| 4725 | 4726 | // Allocate reference sums |
| 4726 | 4727 | int sum = 0; |
| ... | ... | @@ -5084,7 +5085,7 @@ void test_bintable_bit(void) |
| 5084 | 5085 | |
| 5085 | 5086 | // Remove FITS file |
| 5086 | 5087 | std::string cmd = "rm -rf "+ filename; |
| 5087 | - system(cmd.c_str()); | |
| 5088 | + int rc = system(cmd.c_str()); | |
| 5088 | 5089 | |
| 5089 | 5090 | // Allocate reference sums |
| 5090 | 5091 | int sum = 0; | ... | ... |