Compile time warnings are being lost if a test gets only warnings. So you can't have a test expecting to pass, and check for warnings also.