@ -78,18 +78,15 @@ class SimpleConfigurable : public TestConfigurable<Configurable> {
: TestConfigurable ( name , mode , map ) {
: TestConfigurable ( name , mode , map ) {
if ( ( mode & TestConfigMode : : kUniqueMode ) ! = 0 ) {
if ( ( mode & TestConfigMode : : kUniqueMode ) ! = 0 ) {
unique_ . reset ( SimpleConfigurable : : Create ( " Unique " + name_ ) ) ;
unique_ . reset ( SimpleConfigurable : : Create ( " Unique " + name_ ) ) ;
ConfigurableHelper : : RegisterOptions ( * this , name_ + " Unique " , & unique_ ,
RegisterOptions ( name_ + " Unique " , & unique_ , & unique_option_info ) ;
& unique_option_info ) ;
}
}
if ( ( mode & TestConfigMode : : kSharedMode ) ! = 0 ) {
if ( ( mode & TestConfigMode : : kSharedMode ) ! = 0 ) {
shared_ . reset ( SimpleConfigurable : : Create ( " Shared " + name_ ) ) ;
shared_ . reset ( SimpleConfigurable : : Create ( " Shared " + name_ ) ) ;
ConfigurableHelper : : RegisterOptions ( * this , name_ + " Shared " , & shared_ ,
RegisterOptions ( name_ + " Shared " , & shared_ , & shared_option_info ) ;
& shared_option_info ) ;
}
}
if ( ( mode & TestConfigMode : : kRawPtrMode ) ! = 0 ) {
if ( ( mode & TestConfigMode : : kRawPtrMode ) ! = 0 ) {
pointer_ = SimpleConfigurable : : Create ( " Pointer " + name_ ) ;
pointer_ = SimpleConfigurable : : Create ( " Pointer " + name_ ) ;
ConfigurableHelper : : RegisterOptions ( * this , name_ + " Pointer " , & pointer_ ,
RegisterOptions ( name_ + " Pointer " , & pointer_ , & pointer_option_info ) ;
& pointer_option_info ) ;
}
}
}
}
@ -250,19 +247,15 @@ class ValidatedConfigurable : public SimpleConfigurable {
: SimpleConfigurable ( name , TestConfigMode : : kDefaultMode ) ,
: SimpleConfigurable ( name , TestConfigMode : : kDefaultMode ) ,
validated ( false ) ,
validated ( false ) ,
prepared ( 0 ) {
prepared ( 0 ) {
ConfigurableHelper : : RegisterOptions ( * this , " Validated " , & validated ,
RegisterOptions ( " Validated " , & validated , & validated_option_info ) ;
& validated_option_info ) ;
RegisterOptions ( " Prepared " , & prepared , & prepared_option_info ) ;
ConfigurableHelper : : RegisterOptions ( * this , " Prepared " , & prepared ,
& prepared_option_info ) ;
if ( ( mode & TestConfigMode : : kUniqueMode ) ! = 0 ) {
if ( ( mode & TestConfigMode : : kUniqueMode ) ! = 0 ) {
unique_ . reset ( new ValidatedConfigurable (
unique_ . reset ( new ValidatedConfigurable (
" Unique " + name_ , TestConfigMode : : kDefaultMode , false ) ) ;
" Unique " + name_ , TestConfigMode : : kDefaultMode , false ) ) ;
if ( dont_prepare ) {
if ( dont_prepare ) {
ConfigurableHelper : : RegisterOptions ( * this , name_ + " Unique " , & unique_ ,
RegisterOptions ( name_ + " Unique " , & unique_ , & dont_prepare_option_info ) ;
& dont_prepare_option_info ) ;
} else {
} else {
ConfigurableHelper : : RegisterOptions ( * this , name_ + " Unique " , & unique_ ,
RegisterOptions ( name_ + " Unique " , & unique_ , & unique_option_info ) ;
& unique_option_info ) ;
}
}
}
}
}
}
@ -353,10 +346,8 @@ TEST_F(ConfigurableTest, MutableOptionsTest) {
: SimpleConfigurable ( " mutable " , TestConfigMode : : kDefaultMode |
: SimpleConfigurable ( " mutable " , TestConfigMode : : kDefaultMode |
TestConfigMode : : kUniqueMode |
TestConfigMode : : kUniqueMode |
TestConfigMode : : kSharedMode ) {
TestConfigMode : : kSharedMode ) {
ConfigurableHelper : : RegisterOptions ( * this , " struct " , & options_ ,
RegisterOptions ( " struct " , & options_ , & struct_option_info ) ;
& struct_option_info ) ;
RegisterOptions ( " imm " , & options_ , & imm_option_info ) ;
ConfigurableHelper : : RegisterOptions ( * this , " imm " , & options_ ,
& imm_option_info ) ;
}
}
} ;
} ;
MutableConfigurable mc ;
MutableConfigurable mc ;