Commit e86bfeed authored by Kaitlyn Lee's avatar Kaitlyn Lee
Browse files

Added testing for errors.

parent 84e227c6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ void IsisMain() {
  PvlGroup results("FileInfo");
  results += PvlKeyword( "NumberOfLines", toString(nLines) );
  results += PvlKeyword( "NumberOfBytesPerLine", toString(nBytes) );
  results += PvlKeyword( "BitType", toString(totalBandBits) );
  results += PvlKeyword( "BitType", toString(bitType) );
  int nSamples = nBytes / (totalBandBits / 8);
  results += PvlKeyword( "NumberOfSamples", toString(nSamples) );
  int nBands = (totalBandBits / 8) / dataTypeBytes;
@@ -142,7 +142,7 @@ void IsisMain() {
        p.SetPixelType(Isis::Real);
        break;
      default:
        IString msg = "Unsupported bit per pixel count [" + IString(bitsPerBand) + "]. "; //Do we need this?
        IString msg = "Unsupported bit per pixel count [" + IString(bitsPerBand) + "]. "; //Reword?
        msg += "(Use the raw2isis and crop programs to import the file in case it is ";
        msg += "line or sample interleaved.)";
        throw IException(IException::Io, msg, _FILEINFO_);
+2 −0
Original line number Diff line number Diff line
@@ -4,3 +4,5 @@ include $(ISISROOT)/make/isismake.tsts

commands:
	$(APPNAME) FROM=$(INPUT)/vis1flat.ddd TO=$(OUTPUT)/vis1flat.cub > /dev/null;
	$(APPNAME) FROM=$(INPUT)/0023MD0000140000101507C00_DXXX_16b.ddd \
		TO=$(OUTPUT)/0023MD0000140000101507C00_DXXX_16b.cub > /dev/null;
+19 −0
Original line number Diff line number Diff line
APPNAME = ddd2isis

include $(ISISROOT)/make/isismake.tsts

commands:
	# TEST: Throws an error when trying to open the file
	if [ `$(APPNAME) \
		FROM=$(INPUT)/vis1flat.ddd \
		TO=$(OUTPUT)/vis1flat.cub \
		2> $(OUTPUT)/errorTruth.txt > /dev/null` ]; \
		then true; \
		fi;
	# TEST: Throws an error when trying to read from a cub instead of ddd
	if [ `$(APPNAME) \
		FROM=$(INPUT)/vis1flat.cub \
		TO=$(OUTPUT)/vis1flat.cub \
		2>> $(OUTPUT)/errorTruth.txt > /dev/null` ]; \
		then true; \
		fi;