onnxruntime/onnxruntime/test/common
Edward Chen 5a5fec0452
Fix logs getting skipped in single-line conditionals. (#7589)
Fix an issue where a log message got skipped.

A log call like this:
```
LOGS(...) << "message";
```
expands to something like this:
```
if (<output enabled>)
  logging::Capture(...).Stream() << "message";
```

This if statement without brackets is handy for logging arbitrary arguments with the `<<` operator. However, it has other drawbacks like possibly associating with a subsequent `else`.

```
if (cond)
  LOGS(...) << "a";
else
  <do something> // not run when !cond

// equivalently:
if (cond)
  if (<output enabled>)
    logging::Capture(...).Stream() << "a";
  else
    <do something> // not run when !cond
```

Updated the logging macros to handle this case by replacing `if (<enabled>) logging::Capture(...).Stream()` with `if (!<enabled>) {} else logging::Capture(...).Stream()`.

Thanks @tlh20 for the idea for the fix!
2021-05-07 15:40:47 -07:00
..
logging Fix logs getting skipped in single-line conditionals. (#7589) 2021-05-07 15:40:47 -07:00
cuda_op_test_utils.h
denormal_test.cc
path_test.cc
string_utils_test.cc Rename MakeString and ParseString functions. (#6272) 2021-01-07 15:43:42 -08:00
tensor_op_test_utils.cc Loosen tolerance of CudaKernelTest.ReduceSum_MidTensor, allow test random seed to be regenerated within a test run. (#5675) 2020-11-03 10:37:00 -08:00
tensor_op_test_utils.h QDQ implementation (#7033) 2021-03-25 09:17:23 -07:00
utf8_util_test.cc