+ // --------------------- alarm testing ------------------------------------------
+ std::shared_ptr<xapp::Alarm> a;
+
+ a = x->Alloc_alarm( ); // drive all possible constructors through the framework
+ errors += fail_if( a == NULL, "unable to allcoate a generic alarm" );
+
+ setenv( "ALARM_MGR_SERVICE_NAME", "alarm_svc", 1 );
+ setenv( "ALARM_MGR_SERVICE_PORT", "9999", 1 );
+
+ a = x->Alloc_alarm( "meid-123" );
+ errors += fail_if( a == NULL, "unable to allcoate an alarm with just meid" );
+
+ a = x->Alloc_alarm( 13, "meid-abc" );
+ errors += fail_if( a == NULL, "unable to allcoate an alarm with meid and problem id" );
+
+
+ //#####: 210:xapp::Alarm::Alarm( const Alarm& soi ) {
+ //#####: 227:Alarm& xapp::Alarm::operator=( const Alarm& soi ) {
+ //#####: 249:xapp::Alarm::Alarm( Alarm&& soi ) {
+ //#####: 269:Alarm& xapp::Alarm::operator=( Alarm&& soi ) {
+
+ a->Set_meid( "changed_meid" );
+ for( i = 0; i < 6; i++ ) {
+ a->Set_severity( i ); // drive all switch possibilities
+ }
+
+ a->Set_appid( "new-appid" );
+ a->Set_problem( 99 );
+ a->Set_info( "new information string" );
+ a->Set_additional( "new additional information string" );
+
+ a->Dump();
+ errors += fail_if( !a->Raise(), "alarm raise with no parms failed" );
+ errors += fail_if( !a->Raise( xapp::Alarm::SEV_CRIT, 15, "problem string" ), "alarm raise s/p/i failed" );
+ errors += fail_if( !a->Raise( xapp::Alarm::SEV_CRIT, 15, "problem string", "addtl info" ), "alarm raise s/p/i/a failed" );
+
+ errors += fail_if( !a->Clear( ), "clear alarm failed" );
+ errors += fail_if( !a->Clear( xapp::Alarm::SEV_CRIT, 15, "problem string" ), "alarm clear s/p/i failed" );
+ errors += fail_if( !a->Clear( xapp::Alarm::SEV_CRIT, 15, "problem string", "addtl info" ), "alarm clear s/p/i/a failed" );
+ errors += fail_if( !a->Clear_all( ), "clear all failed" );
+
+ errors += fail_if( !a->Raise_again( ), "alarm raise again failed" );
+
+ xapp::Alarm b = *a.get(); // force the move/copy operator functions to trigger
+ xapp::Alarm c( NULL ); // a useless alarm without a message
+ xapp::Alarm f( NULL, "meid" ); // a useless alarm to drive direct construction
+ c = *a.get(); // drive copy = operator
+
+ b = std::move( c ); // move = operator
+ xapp::Alarm d = std::move( b ); // move constructor
+
+ announce_results( errors );