Refactored macro assertion to improve compile time and reduce duplicated code.