Properly #ifdef some per-platform test code

Change-Id: I286fb35e223f205ecc649aa388471ef1b0823d86