Skip to content

Commit

Permalink
Fix BadContent test
Browse files Browse the repository at this point in the history
  • Loading branch information
harry-cpp committed Nov 22, 2024
1 parent 7fce557 commit 76c956b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion MonoGame.Framework.Content.Pipeline/TextureImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public override TextureContent Import(string filename, ContentImporterContext co
var fBitmap = FreeImage.Load(format, filename, 0);
//if freeimage can not recognize the image type
if(format == FREE_IMAGE_FORMAT.FIF_UNKNOWN)
throw new ContentLoadException("TextureImporter failed to load '" + filename + "'");
throw new InvalidContentException("TextureImporter failed to load '" + filename + "'");
//if freeimage can recognize the file headers but can't read its contents
else if(fBitmap == IntPtr.Zero)
throw new InvalidContentException("TextureImporter couldn't understand the contents of '" + filename + "'", output.Identity);
Expand Down
Binary file modified Tests/Assets/Textures/rgbf.tif
Binary file not shown.
3 changes: 0 additions & 3 deletions Tools/MonoGame.Tools.Tests/TextureImporterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ public void ImportTif( )
/// Note that the image was created with Freeimage from a bitmap
/// </summary>
[Test]
#if MACOS || LINUX
[Ignore("Does not work on Unix based systems. Its odd the test passes?")]
#endif
public void ImportImageWithBadContent( )
{
Assert.Throws(typeof(InvalidContentException), ( ) => ImportStandard("Assets/Textures/rgbf.tif", SurfaceFormat.Vector4, 64));
Expand Down

0 comments on commit 76c956b

Please sign in to comment.