Comments (3)
May be a solution is to use remove_reference
:
#define ASSERT_EQ(expected, actual) \
assertEqual( \
static_cast< std::remove_reference< \
decltype(actual) >::type >(expected), \
actual)
But remove_reference
is not support in current Arduino version (1.8.19) so you need also ArxTypeTraits 0.2.3 by Hideaki Tai.
from aunit.
Maybe the solution is to remove the static_cast<decltype(a)>
? See if the following helps:
https://github.com/bxparks/AUnit/tree/gtest_ref_cast
It fixes your specific problem.
I don't have any code that uses <gtest.h>
, and I'm not entirely sure I understand all the edge cases of the Google Test framework, so not really sure if this is the best solution.
from aunit.
Thanks for your suggestion to remove the static_cast. Yes
that fixes my problem. I thought the static_cast has
the intention to select the correct function from
the set of overloaded assertEqual(). I hoped be the original
author of gtest.h did know.
I'm porting some Tests from x86 to arduino. So I'm doing further
testing with my variant using remove_reference.
So far it seems to work fine. Only disadvantage is that ArxTypeTraits
is required.
from aunit.
Related Issues (20)
- FeatureRequest: support Arduino Nano Every (ATmega4809) HOT 2
- Increase size of TimeoutType from 8 to 16 bits; maybe allow per test timeouts. HOT 3
- Oops Actually Undefined Behaviour # AUnit freezes with strange arithmetic expression on Nano HOT 2
- Error When Running AUnit: fatal error: AUnit.h: No such file or directory HOT 3
- Error When Running AUnit Simple Example HOT 2
- Better documentation using a simple use case HOT 7
- support arduino:samd Core using new Arduino API for versions >= 1.8.10 HOT 1
- test macro not working HOT 9
- Compilation error with Raspberry Pi Pico (RP2040) using Arduino-Pico Core HOT 4
- Missing WProgram.h HOT 1
- Feature request (and patch) : filter test on command line HOT 10
- Issue when used as submodule HOT 8
- Github action for "pull_request" as well as "push"?
- How do you test analogRead and digitalRead?
- Your recommended test for nullptr fails for me. Is this my problem or yours? <EDIT it's mine/> HOT 3
- Error in test headers?
- "unsigned" not implemented ?
- Feature Request: JUnit stylized output
- Test fixture implementation following example didn't work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aunit.