rtc: split out macros into a header file and use in test case