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: github.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:a21e0018-4c69-207f-17ae-d0d64f021e7e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C7A4:1E174F:BF9F3F:10AF9F0:69722862 |
| html-safe-nonce | bbe7ff69ef60210379a5e284472862a6f6ad318958ac67188f95fec189502d78 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0E0OjFFMTc0RjpCRjlGM0Y6MTBBRjlGMDo2OTcyMjg2MiIsInZpc2l0b3JfaWQiOiI3MTQ4NDE2NTU0MTYzNjQ0NTE0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ab6bbff1686ab1026f42c8c1cada1bbf43551ab15845daebc64080f7d70f5a09 |
| 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 | 19a0eb237b419e41a3d6a0867abebfdb845544063fc287c8c486f2fc019a590f |
| 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 | 805f05ae5b701e06271d4ccfc0cbb6252b8b2c21 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width