Replace assert() by wxASSERT to make debug more easy.

This commit is contained in:
jean-pierre charras 2017-10-19 09:49:09 +02:00
parent 72d4889a6d
commit 56d42c776a
1 changed files with 11 additions and 11 deletions

View File

@ -87,12 +87,12 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry )
{
if( !ent.m_copy )
{
assert( changeType != CHT_MODIFY ); // too late to make a copy..
wxASSERT( changeType != CHT_MODIFY ); // too late to make a copy..
ent.m_copy = ent.m_item->Clone();
}
assert( ent.m_item->Type() == PCB_MODULE_T );
assert( ent.m_copy->Type() == PCB_MODULE_T );
wxASSERT( ent.m_item->Type() == PCB_MODULE_T );
wxASSERT( ent.m_copy->Type() == PCB_MODULE_T );
if( aCreateUndoEntry )
{
@ -132,7 +132,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry )
else
{
// modules inside modules are not supported yet
assert( boardItem->Type() != PCB_MODULE_T );
wxASSERT( boardItem->Type() != PCB_MODULE_T );
boardItem->SetParent( board->m_Modules.GetFirst() );
if( !( changeFlags & CHT_DONE ) )
@ -183,7 +183,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry )
break;
default:
assert( false );
wxASSERT( false );
break;
}
}
@ -195,7 +195,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry )
if( !( changeFlags & CHT_DONE ) )
{
MODULE* module = static_cast<MODULE*>( boardItem->GetParent() );
assert( module && module->Type() == PCB_MODULE_T );
wxASSERT( module && module->Type() == PCB_MODULE_T );
module->Delete( boardItem );
}
@ -225,7 +225,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry )
case PCB_MODULE_T:
{
// There are no modules inside a module yet
assert( !m_editModules );
wxASSERT( !m_editModules );
MODULE* module = static_cast<MODULE*>( boardItem );
module->ClearFlags();
@ -242,7 +242,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry )
break;
default: // other types do not need to (or should not) be handled
assert( false );
wxASSERT( false );
break;
}
break;
@ -253,7 +253,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry )
if( !m_editModules && aCreateUndoEntry )
{
ITEM_PICKER itemWrapper( boardItem, UR_CHANGED );
assert( ent.m_copy );
wxASSERT( ent.m_copy );
itemWrapper.SetLink( ent.m_copy );
undoList.PushItem( itemWrapper );
}
@ -271,7 +271,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry )
}
default:
assert( false );
wxASSERT( false );
break;
}
}
@ -381,7 +381,7 @@ void BOARD_COMMIT::Revert()
}
default:
assert( false );
wxASSERT( false );
break;
}
}