Added improvement to code for swift test

Fixes: bug #1200536
Change-Id: Ifc92862048c91ac8105ec8248ae503baa6e29535
Merge "Added improvement to code for swift test"