anim-header: fix some review findings + andd base tests.
parent
83e472cef3
commit
1939aca31c
|
@ -291,8 +291,10 @@ struct aiNodeAnim {
|
|||
, mNumRotationKeys( 0 )
|
||||
, mRotationKeys( NULL )
|
||||
, mNumScalingKeys( 0 )
|
||||
, mScalingKeys( NULL ) {
|
||||
mPreState = mPostState = aiAnimBehaviour_DEFAULT;
|
||||
, mScalingKeys( NULL )
|
||||
, mPreState( aiAnimBehaviour_DEFAULT )
|
||||
, mPostState( aiAnimBehaviour_DEFAULT ) {
|
||||
// empty
|
||||
}
|
||||
|
||||
~aiNodeAnim() {
|
||||
|
@ -372,21 +374,20 @@ struct aiAnimation {
|
|||
|
||||
#ifdef __cplusplus
|
||||
aiAnimation()
|
||||
: mDuration(-1.)
|
||||
, mTicksPerSecond()
|
||||
, mNumChannels()
|
||||
, mChannels()
|
||||
, mNumMeshChannels()
|
||||
, mMeshChannels()
|
||||
{
|
||||
: mDuration(-1.)
|
||||
, mTicksPerSecond(0.)
|
||||
, mNumChannels(0)
|
||||
, mChannels(nullptr)
|
||||
, mNumMeshChannels(0)
|
||||
, mMeshChannels(nullptr) {
|
||||
// empty
|
||||
}
|
||||
|
||||
~aiAnimation()
|
||||
{
|
||||
~aiAnimation() {
|
||||
// DO NOT REMOVE THIS ADDITIONAL CHECK
|
||||
if (mNumChannels && mChannels) {
|
||||
if ( mNumChannels && mChannels ) {
|
||||
for( unsigned int a = 0; a < mNumChannels; a++) {
|
||||
delete mChannels[a];
|
||||
delete mChannels[ a ];
|
||||
}
|
||||
|
||||
delete [] mChannels;
|
||||
|
@ -403,6 +404,7 @@ struct aiAnimation {
|
|||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
}
|
||||
|
||||
/// @brief Some C++ utilities for inter- and extrapolation
|
||||
|
|
|
@ -72,4 +72,36 @@ TEST_F( utAnim, aiQuatKeyTest ) {
|
|||
aiQuatKey constrWithValuesTest( 1.0, q );
|
||||
EXPECT_DOUBLE_EQ( 1.0, constrWithValuesTest.mTime );
|
||||
EXPECT_EQ( q, constrWithValuesTest.mValue );
|
||||
}
|
||||
|
||||
TEST_F( utAnim, aiNodeAnimTest ) {
|
||||
bool ok( true );
|
||||
try {
|
||||
aiNodeAnim myAnim;
|
||||
EXPECT_EQ( aiAnimBehaviour_DEFAULT, myAnim.mPreState );
|
||||
EXPECT_EQ( aiAnimBehaviour_DEFAULT, myAnim.mPostState );
|
||||
} catch ( ... ) {
|
||||
ok = false;
|
||||
}
|
||||
EXPECT_TRUE( ok );
|
||||
}
|
||||
|
||||
TEST_F( utAnim, aiMeshAnimTest ) {
|
||||
bool ok( true );
|
||||
try {
|
||||
aiMeshAnim myMeshAnim;
|
||||
} catch ( ... ) {
|
||||
ok = false;
|
||||
}
|
||||
EXPECT_TRUE( ok );
|
||||
}
|
||||
|
||||
TEST_F( utAnim, aiAnimationTest ) {
|
||||
bool ok( true );
|
||||
try {
|
||||
aiAnimation myAnimation;
|
||||
} catch ( ... ) {
|
||||
ok = false;
|
||||
}
|
||||
EXPECT_TRUE( ok );
|
||||
}
|
Loading…
Reference in New Issue