Ash Barty will face Iga Swiatek at the Madrid Open after surviving a difficult test against Tamara Zidansek. Petra Kvitova also won through.