[riot-notifications] [RIOT-OS/RIOT] tests/thread_float: improve and add script (#16901)

Martine Lenders notifications at github.com
Wed Sep 29 17:42:18 CEST 2021


@miri64 commented on this pull request.



> +    if (first_thread == 1):
+        assertAlmostEqual(float(first_result), 141.44372894635987)
+        assertAlmostEqual(float(second_result), 141.44372894635987)
+    else:
+        assertAlmostEqual(float(second_result), 141.44372894635987)
+        assertAlmostEqual(float(first_result), 141.44372894635987)

Maybe use a `zip()` loop in that case. Prevents copy-pasta ;-)
```suggestion
    if (first_thread == 1):
        results = [float(first_result), float(second_result)]
    else:
        results = [float(second_result), float(first_result)]
    for result, expected in zip(results, [141.44372894635987, second_number]):
        assertAlmostEqual(result, expected)
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16901#discussion_r718650610
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210929/d6e95586/attachment.htm>


More information about the notifications mailing list