Fix CI errors in the unit tests

This commit is contained in:
Ian McInerney
2019-08-05 01:16:16 +02:00
parent d82351ffa3
commit ef59628376

View File

@@ -746,10 +746,12 @@ TEST_CASE( "wxMenuItemAccelEntry", "[menu][accelentry]" )
SECTION( "Modifier keys" ) SECTION( "Modifier keys" )
{ {
for( auto key : modKeys ) std::vector<key>::iterator k;
for( k = modKeys.begin(); k < modKeys.end(); k++ )
{ {
INFO( wxString::Format( "Modifier: %s", key.name ) ); INFO( wxString::Format( "Modifier: %s", k->name ) );
wxAcceleratorEntry accelEntry( key.keycode, 'A' , wxID_ANY, item ); wxAcceleratorEntry accelEntry( k->keycode, 'A' , wxID_ANY, item );
item->SetAccel( &accelEntry ); item->SetAccel( &accelEntry );
wxString labelText = item->GetItemLabel(); wxString labelText = item->GetItemLabel();
@@ -761,19 +763,21 @@ TEST_CASE( "wxMenuItemAccelEntry", "[menu][accelentry]" )
SECTION( "Special keys" ) SECTION( "Special keys" )
{ {
for( auto key : specialKeys ) std::vector<key>::iterator k;
for( k = specialKeys.begin(); k < specialKeys.end(); k++ )
{ {
if( key.skip ) if( k->skip )
continue; continue;
INFO( wxString::Format( "Keycode: %s", key.name ) ); INFO( wxString::Format( "Keycode: %s", k->name ) );
wxAcceleratorEntry accelEntry( wxACCEL_CTRL, key.keycode, wxID_ANY, item ); wxAcceleratorEntry accelEntry( wxACCEL_CTRL, k->keycode, wxID_ANY, item );
item->SetAccel( &accelEntry ); item->SetAccel( &accelEntry );
wxString labelText = item->GetItemLabel(); wxString labelText = item->GetItemLabel();
INFO( wxString::Format( "Label text: %s", labelText ) ); INFO( wxString::Format( "Label text: %s", labelText ) );
verifyAccelAssigned( labelText, key.keycode ); verifyAccelAssigned( labelText, k->keycode );
} }
} }
} }