Title: Bug in TEST_ASSERT_DELTA() and TEST_ASSERT_DELTA_MSG() · Issue #18 · cpptest/cpptest · GitHub
Open Graph Title: Bug in TEST_ASSERT_DELTA() and TEST_ASSERT_DELTA_MSG() · Issue #18 · cpptest/cpptest
X Title: Bug in TEST_ASSERT_DELTA() and TEST_ASSERT_DELTA_MSG() · Issue #18 · cpptest/cpptest
Description: I just ran into a rather nasty bug. The TEST_ASSERT_DELTA() and TEST_ASSERT_DELTA_MSG() macros will happily accept the test if either a, b, or delta is NaN. In my opinion such a test should always fail. A simple fix would be to negate th...
Open Graph Description: I just ran into a rather nasty bug. The TEST_ASSERT_DELTA() and TEST_ASSERT_DELTA_MSG() macros will happily accept the test if either a, b, or delta is NaN. In my opinion such a test should always ...
X Description: I just ran into a rather nasty bug. The TEST_ASSERT_DELTA() and TEST_ASSERT_DELTA_MSG() macros will happily accept the test if either a, b, or delta is NaN. In my opinion such a test should always ...
Opengraph URL: https://github.com/cpptest/cpptest/issues/18
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug in TEST_ASSERT_DELTA() and TEST_ASSERT_DELTA_MSG()","articleBody":"I just ran into a rather nasty bug. The TEST_ASSERT_DELTA() and TEST_ASSERT_DELTA_MSG() macros will happily accept the test if either a, b, or delta is NaN. In my opinion such a test should always fail. A simple fix would be to negate the test, i.e. change\r\n\r\nif (((b) \u003c (a) - (delta)) || ((b) \u003e (a) + (delta)))\r\n\r\ninto\r\n\r\nif (!(((b) \u003e= (a) - (delta)) \u0026\u0026 ((b) \u003c= (a) + (delta))))\r\n\r\nsince comparisons involving NaN will always return false (except for !=, but that is not relevant here).","author":{"url":"https://github.com/pvh513","@type":"Person","name":"pvh513"},"datePublished":"2020-07-01T00:34:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/18/cpptest/issues/18"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c99aa4c7-1f92-814d-c1b7-4b99e76ff470 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BD40:2586AA:5B0BC61:7594460:697668BD |
| html-safe-nonce | 7efe9791b8d22be0e4166e642cdad5ac2bf0f2304f3e610a1fbdfa76b92156f5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDQwOjI1ODZBQTo1QjBCQzYxOjc1OTQ0NjA6Njk3NjY4QkQiLCJ2aXNpdG9yX2lkIjoiODQxMzY4MzQ4NDUwMTAxMDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9f2577b32be63c629213547eab83493014e246c6a54eab58f59e5cf148a3d730 |
| hovercard-subject-tag | issue:648586009 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cpptest/cpptest/18/issue_layout |
| twitter:image | https://opengraph.githubassets.com/696aa4492715ac11bd939844427a225678e27ea0a78b5e8b68155ffa663a6f36/cpptest/cpptest/issues/18 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/696aa4492715ac11bd939844427a225678e27ea0a78b5e8b68155ffa663a6f36/cpptest/cpptest/issues/18 |
| og:image:alt | I just ran into a rather nasty bug. The TEST_ASSERT_DELTA() and TEST_ASSERT_DELTA_MSG() macros will happily accept the test if either a, b, or delta is NaN. In my opinion such a test should always ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pvh513 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 032152924a283b83384255d9489e7b93b54ba01da8d380b05ecd3953b3212411 |
| turbo-cache-control | no-preview |
| go-import | github.com/cpptest/cpptest git https://github.com/cpptest/cpptest.git |
| octolytics-dimension-user_id | 13911119 |
| octolytics-dimension-user_login | cpptest |
| octolytics-dimension-repository_id | 85880737 |
| octolytics-dimension-repository_nwo | cpptest/cpptest |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 85880737 |
| octolytics-dimension-repository_network_root_nwo | cpptest/cpptest |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5b577f6be6482e336e3c30e8daefa30144947b17 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width