-#define TEST(fxn, ...) do { \
- u32 t1 = porting::getTime(PRECISION_MILLI); \
- try { \
- fxn(__VA_ARGS__); \
- dstream << "[PASS] "; \
- } catch (TestFailedException &e) { \
- dstream << "[FAIL] "; \
- num_tests_failed++; \
- } catch (std::exception &e) { \
- dstream << "Caught unhandled exception: " << e.what() << std::endl; \
- dstream << "[FAIL] "; \
- num_tests_failed++; \
- } \
- num_tests_run++; \
- u32 tdiff = porting::getTime(PRECISION_MILLI) - t1; \
- dstream << #fxn << " - " << tdiff << "ms" << std::endl; \
-} while (0)
+#define TEST(fxn, ...) { \
+ u64 t1 = porting::getTimeMs(); \
+ try { \
+ fxn(__VA_ARGS__); \
+ rawstream << "[PASS] "; \
+ } catch (TestFailedException &e) { \
+ rawstream << "[FAIL] "; \
+ num_tests_failed++; \
+ } catch (std::exception &e) { \
+ rawstream << "Caught unhandled exception: " << e.what() << std::endl; \
+ rawstream << "[FAIL] "; \
+ num_tests_failed++; \
+ } \
+ num_tests_run++; \
+ u64 tdiff = porting::getTimeMs() - t1; \
+ rawstream << #fxn << " - " << tdiff << "ms" << std::endl; \
+}