Browse Source

Any{Image,Scene}Importer: explicitly test all recognized extensions.

pull/674/head
Vladimír Vondruš 1 year ago
parent
commit
ac17573961
  1. 9
      src/MagnumPlugins/AnyImageImporter/AnyImageImporter.h
  2. 45
      src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp
  3. 29
      src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp

9
src/MagnumPlugins/AnyImageImporter/AnyImageImporter.h

@ -84,16 +84,13 @@ Supported formats:
@ref BasisImporter is tried as a fallback.
- Multiple-image Network Graphics (`*.mng`), loaded with any plugin that
provides `MngImporter`
- Portable Bitmap (`*.pbm`), loaded with any plugin that provides `PbmImporter`
- Portable Bitmap, Graymap, Pixmap, Anymap (`*.pbm`, `*.pgm`, `*.ppm`,
`*.pnm`), loaded with any plugin that provides `PbmImporter`,
`PgmImporter`, `PpmImporter` or `PnmImporter`, respectively
- ZSoft PCX (`*.pcx`), loaded with any plugin that provides `PcxImporter`
- Portable Graymap (`*.pgm`), loaded with any plugin that provides
`PgmImporter`
- Softimage PIC (`*.pic`), loaded with any plugin that provides `PicImporter`
- Portable Anymap (`*.pnm`), loaded with any plugin that provides
`PnmImporter`
- Portable Network Graphics (`*.png` or data with corresponding signature),
loaded with @ref PngImporter or any other plugin that provides it
- Portable Pixmap (`*.ppm`), loaded with any plugin that provides `PpmImporter`
- Adobe Photoshop (`*.psd`), loaded with any plugin that provides `PsdImporter`
- Silicon Graphics (`*.sgi`, `*.bw`, `*.rgb`, `*.rgba`), loaded with any
plugin that provides `SgiImporter`

45
src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp

@ -90,32 +90,49 @@ constexpr struct {
bool asData;
const char* plugin;
} DetectData[]{
/* Try to keep the order the same as in the documentation, and use all
variants if there are */
{"ASTC", "8x8.astc", false, "AstcImporter"},
{"ASTC data", "8x8.astc", true, "AstcImporter"},
{"PNG", "rgb.png", false, "PngImporter"},
{"PNG data", "rgb.png", true, "PngImporter"},
{"JPEG", "gray.jpg", false, "JpegImporter"},
{"JPEG data", "gray.jpg", true, "JpegImporter"},
{"JPEG uppercase", "uppercase.JPG", false, "JpegImporter"},
{"JPEG2000", "image.jp2", false, "Jpeg2000Importer"},
{"Basis", "rgb.basis", false, "BasisImporter"},
{"Basis data", "rgb.basis", true, "BasisImporter"},
{"BMP", "rgb.bmp", false, "BmpImporter"},
{"BMP data", "rgb.bmp", true, "BmpImporter"},
{"DDS", "rgba_dxt1.dds", false, "DdsImporter"},
{"DDS data", "rgba_dxt1.dds", true, "DdsImporter"},
{"GIF", "image.gif", false, "GifImporter"},
{"OpenEXR", "skybox.exr", false, "OpenExrImporter"},
{"HDR", "rgb.hdr", false, "HdrImporter"},
{"HDR data", "rgb.hdr", true, "HdrImporter"},
{"HDR data, different signature", "rgb.2.hdr", true, "HdrImporter"},
{"ICO", "pngs.ico", false, "IcoImporter"},
{"DDS", "rgba_dxt1.dds", false, "DdsImporter"},
{"DDS data", "rgba_dxt1.dds", true, "DdsImporter"},
{"BMP", "rgb.bmp", false, "BmpImporter"},
{"BMP data", "rgb.bmp", true, "BmpImporter"},
{"GIF", "image.gif", false, "GifImporter"},
{"JPEG", "gray.jpg", false, "JpegImporter"},
{"JPEG data", "gray.jpg", true, "JpegImporter"},
{"JPEG uppercase", "uppercase.JPG", false, "JpegImporter"},
{"JPEG2000", "image.jp2", false, "Jpeg2000Importer"},
/* KTX2, including data, tested sufficiently elsewhere */
{"MNG", "obsolete.mng", false, "MngImporter"},
{"Portable Bitmap", "text.pbm", false, "PbmImporter"},
{"Portable Graymap", "text.pgm", false, "PgmImporter"},
{"Portable Anymap", "text.pnm", false, "PnmImporter"},
{"Portable Pixmap", "text.ppm", false, "PpmImporter"},
{"ZSoft PCX", "image.pcx", false, "PcxImporter"},
{"Softimage PIC", "image.pic", false, "PicImporter"},
{"PNG", "rgb.png", false, "PngImporter"},
{"PNG data", "rgb.png", true, "PngImporter"},
{"PSD", "image.psd", false, "PsdImporter"},
{"Sillicon Graphics SGI", "pixar.sgi", false, "SgiImporter"},
{"Sillicon Graphics BW", "pixar.bw", false, "SgiImporter"},
{"Sillicon Graphics RGB", "pixar.rgb", false, "SgiImporter"},
{"Sillicon Graphics RGBA", "pixar.rgba", false, "SgiImporter"},
{"TIFF", "image.tiff", false, "TiffImporter"},
{"TIFF, 3-character extension", "image.tif", false, "TiffImporter"},
{"TIFF data", "image.tiff", true, "TiffImporter"},
{"Basis", "rgb.basis", false, "BasisImporter"},
{"Basis data", "rgb.basis", true, "BasisImporter"},
/* TGA, including data, tested sufficiently elsewhere. The extension
variants however cannot be tested because the plugin is available. */
{"OpenVDB", "volume.vdb", false, "OpenVdbImporter"},
{"WebP", "rgb-lossless.webp", false, "WebPImporter"},
{"WebP data", "rgb-lossless.webp", true, "WebPImporter"}
/* Not testing everything, just the most important ones */
};
const struct {

29
src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp

@ -117,23 +117,46 @@ const struct {
{"OBJ", Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-multiple.obj")},
};
constexpr struct {
const struct {
const char* name;
const char* filename;
const char* plugin;
} DetectData[]{
/* Try to keep the order the same as in the documentation, and use all
variants if there are */
{"3ds Max", "autodesk.3ds", "3dsImporter"},
{"3ds Max ASE", "autodesk.ase", "3dsImporter"},
{"3MF", "print.3mf", "3mfImporter"},
{"AC3D", "file.ac", "Ac3dImporter"},
{"Blender", "suzanne.blend", "BlenderImporter"},
{"Biovision BVH", "scene.bvh", "BvhImporter"},
{"CharacterStudio Motion", "motion.csm", "CsmImporter"},
{"COLLADA", "xml.dae", "ColladaImporter"},
{"3MF", "print.3mf", "3mfImporter"},
{"DirectX X", "microsoft.x", "DirectXImporter"},
{"AutoCAD DXF", "autodesk.dxf", "DxfImporter"},
{"FBX", "autodesk.fbx", "FbxImporter"},
{"glTF", "khronos.gltf", "GltfImporter"},
{"glTF binary", "khronos.glb", "GltfImporter"},
{"VRM", "humanoid.vrm", "GltfImporter"},
{"IFC", "step.ifc", "IfcImporter"},
{"Irrlicht", "venerable.irr", "IrrlichtImporter"},
{"Irrlicht Mesh", "venerable.irrmesh", "IrrlichtImporter"},
{"LightWave", "magnum.lwo", "LightWaveImporter"},
{"LightWave Scene", "magnum.lws", "LightWaveImporter"},
{"Modo", "magnum.lxo", "ModoImporter"},
{"Milkshape 3D", "latte.ms3d", "MilkshapeImporter"},
{"Ogre XML", "weapon.mesh.xml", "OgreImporter"},
{"OpenGEX", "eric.ogex", "OpenGexImporter"},
{"Stanford PLY", "bunny.ply", "StanfordImporter"},
{"Stanford PLY uppercase", "ARMADI~1.PLY", "StanfordImporter"},
{"STL", "robot.stl", "StlImporter"},
/* Not testing everything, only the most important ones */
{"TrueSpace COB", "huh.cob", "TrueSpaceImporter"},
{"TrueSpace SCN", "huh.scn", "TrueSpaceImporter"},
{"Unreal", "tournament.3d", "UnrealImporter"},
{"Valve Model SMD", "hl3.smd", "ValveImporter"},
{"Valve Model VTA", "hl3.vta", "ValveImporter"},
{"XGL", "thingy.xgl", "XglImporter"},
{"XGL compressed", "thingy.zgl", "XglImporter"},
};
const struct {

Loading…
Cancel
Save