Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 20, 2012, 12:52:15 AM (13 years ago)
Author:
landauf
Message:

changed hasDefaultValue() to lastConversionSuccessful() (inverted meaning) and fixed two issues with this function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/testing/test/util/MultiTypeTest.cc

    r9225 r9226  
    2929    // ? getPointer()
    3030
    31     // x hasDefaultValue()
     31    // x lastConversionSuccessful()
    3232    // x null()
    3333
     
    142142        EXPECT_TRUE(mt.isType<Vector3>());
    143143        EXPECT_EQ(Vector3(1, 2, 3), mt.get<Vector3>());
    144         EXPECT_FALSE(mt.hasDefaultValue());
     144        EXPECT_TRUE(mt.lastConversionSuccessful());
    145145
    146146        mt = 77.7f;
     
    148148        EXPECT_TRUE(mt.isType<Vector3>());
    149149        EXPECT_EQ(Vector3::ZERO, mt.get<Vector3>());
    150         EXPECT_TRUE(mt.hasDefaultValue());
     150        EXPECT_FALSE(mt.lastConversionSuccessful());
    151151    }
    152152
     
    254254        EXPECT_TRUE(mt.isType<int>());
    255255        EXPECT_EQ(0, mt.get<int>());
    256 
    257 //        EXPECT_TRUE(mt.hasDefaultValue());
    258256    }
    259257
     
    287285        EXPECT_EQ(Vector3::ZERO, mt.get<Vector3>());
    288286
    289 //        EXPECT_TRUE(mt.hasDefaultValue());
     287        EXPECT_FALSE(mt.lastConversionSuccessful());
    290288    }
    291289
     
    648646    }
    649647
    650     ///////////////////////
    651     // hasDefaultValue() //
    652     ///////////////////////
    653     TEST(MultiType, HasDefaultValue)
     648    ////////////////////////////////
     649    // lastConversionSuccessful() //
     650    ////////////////////////////////
     651    TEST(MultiType, LastConversionSuccessful)
    654652    {
    655653        MultiType mt;
    656654
    657 //        EXPECT_FALSE(mt.hasDefaultValue());
     655        EXPECT_TRUE(mt.lastConversionSuccessful());
    658656
    659657        mt = 5.55;
    660658
    661         EXPECT_FALSE(mt.hasDefaultValue());
     659        EXPECT_TRUE(mt.lastConversionSuccessful());
    662660
    663661        mt.convert<int>();
    664662
    665         EXPECT_FALSE(mt.hasDefaultValue());
    666 
    667         mt.convert<Quaternion>();
    668 
    669 //        EXPECT_TRUE(mt.hasDefaultValue());
     663        EXPECT_TRUE(mt.lastConversionSuccessful());
     664
     665        mt.convert<Vector3>();
     666
     667        EXPECT_FALSE(mt.lastConversionSuccessful());
     668
     669        mt.convert<std::string>();
     670
     671        EXPECT_TRUE(mt.lastConversionSuccessful());
    670672    }
    671673
Note: See TracChangeset for help on using the changeset viewer.