Skip to content
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

Add SPI to ArduinoFake #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

rcalcover
Copy link
Owner

@rcalcover rcalcover commented Mar 2, 2020

Hi I am trying to add SPI Arduino Core library and contribute in ArduinoFake for the community.
I have followed the contribution guidelines and added SPI the same way as the Print since its quite similar to it. The issue was that I encountered an error that I was stuck on ArduinoFake.h:

                 from test/main.cpp:1:
src/ArduinoFake.h: In member function ‘SPIClassFake* ArduinoFakeContext::SPIClass(SPIClass*)’:
src/ArduinoFake.h:59:52: error: cannot dynamic_cast ‘instance’ (of type ‘class SPIClass*’) to type ‘class SPIClassFakeProxy*’ (source type is not polymorphic)
         if (dynamic_cast<name##FakeProxy*>(instance)) { \
                                                    ^
src/ArduinoFake.h:103:9: note: in expansion of macro ‘_ArduinoFakeInstanceGetter2’
         _ArduinoFakeInstanceGetter2(SPIClass, SPIClass)
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ArduinoFake.h:60:59: error: cannot dynamic_cast ‘instance’ (of type ‘class SPIClass*’) to type ‘class SPIClassFakeProxy*’ (source type is not polymorphic)
             return dynamic_cast<name##FakeProxy*>(instance)->get##name##Fake(); \
                                                           ^
src/ArduinoFake.h:103:9: note: in expansion of macro ‘_ArduinoFakeInstanceGetter2’
         _ArduinoFakeInstanceGetter2(SPIClass, SPIClass)` 

It showed when I added _ArduinoFakeInstanceGetter2(SPIClass, SPIClass) on ArduinoFakeContext.

nerdyscout pushed a commit to nerdyscout/ArduinoFake that referenced this pull request Jan 1, 2023
Prevents build warnings when built under gnu++12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant