Improved code generation testing in domain test