Skip to content

Commit 4cad1e2

Browse files
committed
add messages to bone weight asserts
1 parent d5febfe commit 4cad1e2

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

Assets/FbxExporters/Editor/UnitTests/ModelExporterTest.cs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -634,22 +634,26 @@ public void TestBoneWeightExport()
634634
var origBw = origBoneWeights[i];
635635
var expBw = expBoneWeights [j];
636636

637-
Assert.That (expBw.boneIndex0, Is.EqualTo (origBw.boneIndex0));
638-
Assert.That (expBones[expBw.boneIndex0].name, Is.EqualTo (origBones[origBw.boneIndex0].name));
637+
var indexMsg = "Bone index {0} doesn't match";
638+
var nameMsg = "bone names don't match";
639639

640-
Assert.That (expBw.boneIndex1, Is.EqualTo (origBw.boneIndex1));
641-
Assert.That (expBones[expBw.boneIndex1].name, Is.EqualTo (origBones[origBw.boneIndex1].name));
640+
Assert.That (expBw.boneIndex0, Is.EqualTo (origBw.boneIndex0), string.Format(indexMsg, 0));
641+
Assert.That (expBones[expBw.boneIndex0].name, Is.EqualTo (origBones[origBw.boneIndex0].name), nameMsg);
642642

643-
Assert.That (expBw.boneIndex2, Is.EqualTo (origBw.boneIndex2));
644-
Assert.That (expBones[expBw.boneIndex2].name, Is.EqualTo (origBones[origBw.boneIndex2].name));
643+
Assert.That (expBw.boneIndex1, Is.EqualTo (origBw.boneIndex1), string.Format(indexMsg, 1));
644+
Assert.That (expBones[expBw.boneIndex1].name, Is.EqualTo (origBones[origBw.boneIndex1].name), nameMsg);
645645

646-
Assert.That (expBw.boneIndex3, Is.EqualTo (origBw.boneIndex3));
647-
Assert.That (expBones[expBw.boneIndex3].name, Is.EqualTo (origBones[origBw.boneIndex3].name));
646+
Assert.That (expBw.boneIndex2, Is.EqualTo (origBw.boneIndex2), string.Format(indexMsg, 2));
647+
Assert.That (expBones[expBw.boneIndex2].name, Is.EqualTo (origBones[origBw.boneIndex2].name), nameMsg);
648648

649-
Assert.That (expBw.weight0, Is.EqualTo (origBw.weight0).Within(0.001f));
650-
Assert.That (expBw.weight1, Is.EqualTo (origBw.weight1).Within(0.001f));
651-
Assert.That (expBw.weight2, Is.EqualTo (origBw.weight2).Within(0.001f));
652-
Assert.That (expBw.weight3, Is.EqualTo (origBw.weight3).Within(0.001f));
649+
Assert.That (expBw.boneIndex3, Is.EqualTo (origBw.boneIndex3), string.Format(indexMsg, 3));
650+
Assert.That (expBones[expBw.boneIndex3].name, Is.EqualTo (origBones[origBw.boneIndex3].name), nameMsg);
651+
652+
var message = "Bone weight {0} doesn't match";
653+
Assert.That (expBw.weight0, Is.EqualTo (origBw.weight0).Within(0.001f), string.Format(message, 0));
654+
Assert.That (expBw.weight1, Is.EqualTo (origBw.weight1).Within(0.001f), string.Format(message, 1));
655+
Assert.That (expBw.weight2, Is.EqualTo (origBw.weight2).Within(0.001f), string.Format(message, 2));
656+
Assert.That (expBw.weight3, Is.EqualTo (origBw.weight3).Within(0.001f), string.Format(message, 3));
653657

654658
comparisonCount++;
655659
break;

0 commit comments

Comments
 (0)