@@ -636,24 +636,24 @@ mod tests {
636636
637637 // Verify that using the normal `fitsio` gives the wrong result, unless
638638 // the type is an i64.
639- let foo_i32 = hdu. read_key :: < i32 > ( fptr, "foo " ) ;
640- let foo_i64 = hdu. read_key :: < i64 > ( fptr, "foo " ) ;
641- assert ! ( foo_i32 . is_ok( ) ) ;
642- assert ! ( foo_i64 . is_ok( ) ) ;
643- assert_eq ! ( foo_i32 . unwrap( ) , 1 ) ;
644- assert_eq ! ( foo_i64 . unwrap( ) , 10 ) ;
645-
646- // Despite writing to "foo ", the key is written as "FOO".
647- let foo_i64 = hdu. read_key :: < i64 > ( fptr, "FOO" ) ;
648- assert ! ( foo_i64 . is_ok( ) ) ;
649- assert_eq ! ( foo_i64 . unwrap( ) , 10 ) ;
650-
651- let foo_u8 : Result < u8 , _ > = get_required_fits_key ! ( fptr, & hdu, "foo" ) ;
652- let foo_i8 : Result < i8 , _ > = get_required_fits_key ! ( fptr, & hdu, "foo" ) ;
653- assert ! ( foo_u8 . is_ok( ) ) ;
654- assert ! ( foo_i8 . is_ok( ) ) ;
655- assert_eq ! ( foo_u8 . unwrap( ) , 10 ) ;
656- assert_eq ! ( foo_i8 . unwrap( ) , 10 ) ;
639+ let fits_value_i32 = hdu. read_key :: < i32 > ( fptr, "FOO " ) ;
640+ let fits_value_i64 = hdu. read_key :: < i64 > ( fptr, "FOO " ) ;
641+ assert ! ( fits_value_i32 . is_ok( ) ) ;
642+ assert ! ( fits_value_i64 . is_ok( ) ) ;
643+ assert_eq ! ( fits_value_i32 . unwrap( ) , 1 ) ;
644+ assert_eq ! ( fits_value_i64 . unwrap( ) , 10 ) ;
645+
646+ // Despite writing to "fits_value ", the key is written as "FOO".
647+ let fits_value_i64 = hdu. read_key :: < i64 > ( fptr, "FOO" ) ;
648+ assert ! ( fits_value_i64 . is_ok( ) ) ;
649+ assert_eq ! ( fits_value_i64 . unwrap( ) , 10 ) ;
650+
651+ let fits_value_u8 : Result < u8 , _ > = get_required_fits_key ! ( fptr, & hdu, "foo" ) ;
652+ let fits_value_i8 : Result < i8 , _ > = get_required_fits_key ! ( fptr, & hdu, "foo" ) ;
653+ assert ! ( fits_value_u8 . is_ok( ) ) ;
654+ assert ! ( fits_value_i8 . is_ok( ) ) ;
655+ assert_eq ! ( fits_value_u8 . unwrap( ) , 10 ) ;
656+ assert_eq ! ( fits_value_i8 . unwrap( ) , 10 ) ;
657657
658658 // Can't parse the negative number into a unsigned int.
659659 let bar_u8: Result < u8 , _ > = get_required_fits_key ! ( fptr, & hdu, "bar" ) ;
@@ -671,9 +671,9 @@ mod tests {
671671 let hdu = fptr. hdu ( 0 ) . expect ( "Couldn't open HDU 0" ) ;
672672
673673 // Failure to get a key that doesn't exist is OK if we're using the optional variant.
674- let foo : Result < Option < u8 > , _ > = get_optional_fits_key ! ( fptr, & hdu, "foo" ) ;
675- assert ! ( foo . is_ok( ) ) ;
676- assert ! ( foo . unwrap( ) . is_none( ) ) ;
674+ let fits_value : Result < Option < u8 > , _ > = get_optional_fits_key ! ( fptr, & hdu, "foo" ) ;
675+ assert ! ( fits_value . is_ok( ) ) ;
676+ assert ! ( fits_value . unwrap( ) . is_none( ) ) ;
677677
678678 // Key types must be i64 to get any sort of sanity.
679679 hdu. write_key ( fptr, "foo" , 10i64 )
@@ -683,24 +683,24 @@ mod tests {
683683
684684 // Verify that using the normal `fitsio` gives the wrong result, unless
685685 // the type is an i64.
686- let foo_i32 = hdu. read_key :: < i32 > ( fptr, "foo " ) ;
687- let foo_i64 = hdu. read_key :: < i64 > ( fptr, "foo " ) ;
688- assert ! ( foo_i32 . is_ok( ) ) ;
689- assert ! ( foo_i64 . is_ok( ) ) ;
690- assert_eq ! ( foo_i32 . unwrap( ) , 1 ) ;
691- assert_eq ! ( foo_i64 . unwrap( ) , 10 ) ;
686+ let fits_value_i32 = hdu. read_key :: < i32 > ( fptr, "FOO " ) ;
687+ let fits_value_i64 = hdu. read_key :: < i64 > ( fptr, "FOO " ) ;
688+ assert ! ( fits_value_i32 . is_ok( ) ) ;
689+ assert ! ( fits_value_i64 . is_ok( ) ) ;
690+ assert_eq ! ( fits_value_i32 . unwrap( ) , 1 ) ;
691+ assert_eq ! ( fits_value_i64 . unwrap( ) , 10 ) ;
692692
693693 // Despite writing to "foo", the key is written as "FOO".
694- let foo_i64 = hdu. read_key :: < i64 > ( fptr, "FOO" ) ;
695- assert ! ( foo_i64 . is_ok( ) ) ;
696- assert_eq ! ( foo_i64 . unwrap( ) , 10 ) ;
694+ let fits_value_i64 = hdu. read_key :: < i64 > ( fptr, "FOO" ) ;
695+ assert ! ( fits_value_i64 . is_ok( ) ) ;
696+ assert_eq ! ( fits_value_i64 . unwrap( ) , 10 ) ;
697697
698- let foo_u8 : Result < Option < u8 > , _ > = get_optional_fits_key ! ( fptr, & hdu, "foo" ) ;
699- let foo_i8 : Result < Option < i8 > , _ > = get_optional_fits_key ! ( fptr, & hdu, "foo" ) ;
700- assert ! ( foo_u8 . is_ok( ) ) ;
701- assert ! ( foo_i8 . is_ok( ) ) ;
702- assert_eq ! ( foo_u8 . unwrap( ) , Some ( 10 ) ) ;
703- assert_eq ! ( foo_i8 . unwrap( ) , Some ( 10 ) ) ;
698+ let fits_value_u8 : Result < Option < u8 > , _ > = get_optional_fits_key ! ( fptr, & hdu, "foo" ) ;
699+ let fits_value_i8 : Result < Option < i8 > , _ > = get_optional_fits_key ! ( fptr, & hdu, "foo" ) ;
700+ assert ! ( fits_value_u8 . is_ok( ) ) ;
701+ assert ! ( fits_value_i8 . is_ok( ) ) ;
702+ assert_eq ! ( fits_value_u8 . unwrap( ) , Some ( 10 ) ) ;
703+ assert_eq ! ( fits_value_i8 . unwrap( ) , Some ( 10 ) ) ;
704704
705705 // Can't parse the negative number into a unsigned int.
706706 let bar_u8: Result < u8 , _ > = get_required_fits_key ! ( fptr, & hdu, "bar" ) ;
@@ -719,18 +719,19 @@ mod tests {
719719
720720 // Failure to get a key that doesn't exist.
721721 let does_not_exist: Result < String , FitsError > =
722- get_required_fits_key ! ( fptr, & hdu, "foo " ) ;
722+ get_required_fits_key ! ( fptr, & hdu, "fits_value " ) ;
723723 assert ! ( does_not_exist. is_err( ) ) ;
724724
725725 // Add a test string
726- hdu. write_key ( fptr, "foo " , "hello" )
727- . expect ( "Couldn't write key 'foo '" ) ;
726+ hdu. write_key ( fptr, "fits_value " , "hello" )
727+ . expect ( "Couldn't write key 'fits_value '" ) ;
728728
729- // Read foo back in
730- let foo_string: String = get_required_fits_key ! ( fptr, & hdu, "foo" ) . unwrap ( ) ;
729+ // Read fits_value back in
730+ let fits_value_string: String =
731+ get_required_fits_key ! ( fptr, & hdu, "fits_value" ) . unwrap ( ) ;
731732
732- // Despite writing to "foo ", the key is written as "FOO".
733- assert_eq ! ( foo_string , "hello" ) ;
733+ // Despite writing to "fits_value ", the key is written as "FOO".
734+ assert_eq ! ( fits_value_string , "hello" ) ;
734735 } ) ;
735736 }
736737
@@ -742,22 +743,22 @@ mod tests {
742743
743744 // No Failure to get a key that doesn't exist.
744745 let does_not_exist: Result < Option < String > , FitsError > =
745- get_optional_fits_key ! ( fptr, & hdu, "foo " ) ;
746+ get_optional_fits_key ! ( fptr, & hdu, "fits_value " ) ;
746747
747748 assert ! ( does_not_exist. is_ok( ) ) ;
748749 assert ! ( does_not_exist. unwrap( ) . is_none( ) ) ;
749750
750751 // Add a test string
751- hdu. write_key ( fptr, "foo " , "hello" )
752- . expect ( "Couldn't write key 'foo '" ) ;
752+ hdu. write_key ( fptr, "fits_value " , "hello" )
753+ . expect ( "Couldn't write key 'fits_value '" ) ;
753754
754- // Read foo back in
755- let foo_string : Result < Option < String > , FitsError > =
756- get_optional_fits_key ! ( fptr, & hdu, "foo " ) ;
755+ // Read fits_value back in
756+ let fits_value_string : Result < Option < String > , FitsError > =
757+ get_optional_fits_key ! ( fptr, & hdu, "fits_value " ) ;
757758
758- // Despite writing to "foo ", the key is written as "FOO".
759- assert ! ( foo_string . is_ok( ) ) ;
760- assert_eq ! ( foo_string . unwrap( ) . unwrap( ) , "hello" ) ;
759+ // Despite writing to "fits_value ", the key is written as "FOO".
760+ assert ! ( fits_value_string . is_ok( ) ) ;
761+ assert_eq ! ( fits_value_string . unwrap( ) . unwrap( ) , "hello" ) ;
761762 } ) ;
762763 }
763764
@@ -788,18 +789,18 @@ mod tests {
788789 ) ;
789790 }
790791
791- let ( status, foo_str ) = unsafe { get_fits_long_string ( fptr. as_raw ( ) , "foo " ) } ;
792+ let ( status, fits_value_str ) = unsafe { get_fits_long_string ( fptr. as_raw ( ) , "FOO " ) } ;
792793 assert_eq ! ( status, 0 ) ;
793- assert_eq ! ( foo_str , complete_string) ;
794+ assert_eq ! ( fits_value_str , complete_string) ;
794795
795796 // Try out the `fitsio` read key.
796797 let hdu = fptr. hdu ( 0 ) . expect ( "Couldn't open HDU 0" ) ;
797- let fitsio_str = hdu. read_key :: < String > ( fptr, "foo " ) ;
798+ let fitsio_str = hdu. read_key :: < String > ( fptr, "FOO " ) ;
798799 assert ! ( fitsio_str. is_ok( ) ) ;
799800 assert_eq ! ( fitsio_str. unwrap( ) , first_string) ;
800801
801802 // A repeated read just returns the first string again.
802- let fitsio_str = hdu. read_key :: < String > ( fptr, "foo " ) ;
803+ let fitsio_str = hdu. read_key :: < String > ( fptr, "FOO " ) ;
803804 assert ! ( fitsio_str. is_ok( ) ) ;
804805 assert_eq ! ( fitsio_str. unwrap( ) , first_string) ;
805806 } ) ;
@@ -815,8 +816,8 @@ mod tests {
815816 // with CONTINUE statements. We have to do it for ourselves.
816817 unsafe {
817818 let fptr_ffi = fptr. as_raw ( ) ;
818- let keyword_ffi = CString :: new ( "foo " )
819- . expect ( "get_fits_long_string: CString::new() failed for 'foo '" ) ;
819+ let keyword_ffi = CString :: new ( "fits_value " )
820+ . expect ( "get_fits_long_string: CString::new() failed for 'fits_value '" ) ;
820821 let value_ffi = CString :: new ( complete_string)
821822 . expect ( "get_fits_long_string: CString::new() failed for 'complete_string'" ) ;
822823 let mut status = 0 ;
@@ -830,7 +831,7 @@ mod tests {
830831 ) ;
831832 }
832833
833- let ( status, _) = unsafe { get_fits_long_string ( fptr. as_raw ( ) , "NOTfoo " ) } ;
834+ let ( status, _) = unsafe { get_fits_long_string ( fptr. as_raw ( ) , "NOTfits_value " ) } ;
834835 assert_ne ! ( status, 0 ) ;
835836 } ) ;
836837 }
0 commit comments