8000 Allow test framework to use cores/esp8266/Arduino.h directly by mcspr · Pull Request #7377 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Allow test framework to use cores/esp8266/Arduino.h directly #7377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Oct 6, 2020
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
84d8866
Allow test framework to use cores/esp8266/Arduino.h directly
mcspr Jun 14, 2020
c89d0f6
fix wps debugging
mcspr Jun 14, 2020
0e0849d
some more missing debug.h
mcspr Jun 14, 2020
65fab13
Merge remote-tracking branch 'origin/master' into tests/sync-arduino-h
mcspr Jul 17, 2020
555c272
Hunt down debug.h and roll-back
mcspr Jul 17, 2020
6b36f6e
Move abs+round checks to test/device/test_sw
mcspr Jul 17, 2020
ffc3744
Restore macros for C code
mcspr Jul 17, 2020
6db24f8
fixup! Move abs+round checks to test/device/test_sw
mcspr Jul 18, 2020
e59f926
Fix bad c/p, actually try round with ints
mcspr Jul 18, 2020
0c8c7ab
Merge branch 'master' into tests/sync-arduino-h
d-a-v Jul 28, 2020
1f14878
tweak c macros per review
mcspr Aug 16, 2020
9e1b019
Merge remote-tracking branch 'origin/master' into tests/sync-arduino-h
mcspr Aug 17, 2020
247c6c3
fix gcc-10 missing cerrno include
mcspr Aug 17, 2020
685c25f
amend 555c272, again
mcspr Aug 17, 2020
60de322
fixup! Merge remote-tracking branch 'origin/master' into tests/sync-a…
8000 mcspr Aug 17, 2020
1a2fd27
fixup! amend 555c272, again
mcspr Aug 17, 2020
8c89d90
switch to the current -std=... opts
mcspr Aug 17, 2020
f48cd49
Revert "switch to the current -std=... opts"
mcspr Aug 17, 2020
481b351
trying to fix CI, clean-up configTime decl + def
mcspr Aug 17, 2020
b496509
Merge branch 'master' into tests/sync-arduino-h
mcspr Sep 9, 2020
8e7a003
Merge remote-tracking branch 'origin/master' into tests/sync-arduino-h
mcspr Oct 6, 2020
1fa62d4
Merge branch 'master' into tests/sync-arduino-h
mcspr Oct 6, 2020
3d7379f
Merge branch 'master' into tests/sync-arduino-h
d-a-v Oct 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix bad c/p, actually try round with ints
  • Loading branch information
mcspr committed Jul 18, 2020
commit e59f92653517d1f209905c51640e73fadb9f355c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ TEST_CASE("abs works with ints", "[arduino-math]")
CHECK(abs(b) == b);
}

bool compare_floats(float a, float b) {
template <typename T>
bool compare_floats(T a, T b) {
static_assert(std::is_floating_point<T>::value, "");
return std::fabs(a - b) < std::numeric_limits<float>::epsilon();
}

Expand All @@ -60,17 +62,17 @@ TEST_CASE("abs works with floats", "[arduino-math]")
CHECK(compare_floats(abs(b), b));
}

TEST_CASE("round works with floats", "[arduino-math]")
TEST_CASE("round works with ints", "[arduino-math]")
{
float a = 2.9;
float b = 3.0;
CHECK(TEST_MATH_IS_SAME(round(a), a));
CHECK(TEST_MATH_IS_SAME(round(b), b));
CHECK(compare_floats(round(a), b));
CHECK(compare_floats(round(b), b));
int a = 5;
int b = 10;
CHECK(TEST_MATH_IS_SAME(round(a), std::round(a)));
CHECK(TEST_MATH_IS_SAME(round(b), std::round(b)));
CHECK(compare_floats(round(a), std::round(a)));
CHECK(compare_floats(round(b), std::round(b)));
}

TEST_CASE("round result is float", "[arduino-math]")
TEST_CASE("round works with floats", "[arduino-math]")
{
float a = 2.9;
float b = 3.0;
Expand Down
0