2
0
Эх сурвалжийг харах

Fix issue 2889 (molecule_ascii.cob load failure): change integers to floating point values in color triplets (#5819)

* Convert integer values to floating point

* Add reference screenshot

* Restore assert to expect pass instead of fail

---------

Co-authored-by: Steve M <[email protected]>
Steve M 10 сар өмнө
parent
commit
fffce70fce

+ 3 - 3
test/models/COB/molecule_ascii.cob

@@ -1170,7 +1170,7 @@ Object Mode Off 0
 Mat1 V0.08 Id 497131204 Parent 58548212 Size 00000083
 mat# 0
 shader: phong  facet: auto40
-rgb 1,1,1
+rgb 1.0,1.0,1.0
 alpha 1  ka 0  ks 0.1  exp 0  ior 1
 ShBx V0.04 Id 497131205 Parent 497131204 Size 00000605
 Shader class: color
@@ -1758,7 +1758,7 @@ Object Mode Off 0
 Mat1 V0.08 Id 497168220 Parent 57850740 Size 00000083
 mat# 0
 shader: phong  facet: auto40
-rgb 1,1,1
+rgb 1.0,1.0,1.0
 alpha 1  ka 0  ks 0.1  exp 0  ior 1
 ShBx V0.04 Id 497168221 Parent 497168220 Size 00000605
 Shader class: color
@@ -2346,7 +2346,7 @@ Object Mode Off 0
 Mat1 V0.08 Id 497153380 Parent 497235148 Size 00000083
 mat# 0
 shader: phong  facet: auto40
-rgb 1,1,1
+rgb 1.0,1.0,1.0
 alpha 1  ka 0  ks 0.1  exp 0  ior 1
 ShBx V0.04 Id 497153381 Parent 497153380 Size 00000605
 Shader class: color

+ 4 - 0
test/models/COB/ref/README.md

@@ -0,0 +1,4 @@
+# COB 3D model reference images
+
+## molecule_ascii.cob
+![molecule_ascii.cob](molecule_ascii_cob.png)

BIN
test/models/COB/ref/molecule_ascii_cob.png


+ 1 - 3
test/unit/ImportExport/utCOBImportExport.cpp

@@ -63,9 +63,7 @@ TEST(utCOBImporter, importDwarf) {
 TEST(utCOBImporter, importMoleculeASCII) {
     Assimp::Importer importer;
     const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/COB/molecule_ascii.cob", aiProcess_ValidateDataStructure);
-    // FIXME: this is wrong, it should succeed
-    // change to ASSERT_NE after it's been fixed
-    ASSERT_EQ(nullptr, scene);
+    ASSERT_NE(nullptr, scene);
 }
 
 TEST(utCOBImporter, importMolecule) {