Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Using FakeArduino for unit testing with platform io #1676

Copy link
Copy link
Closed
@tickietackie

Description

@tickietackie
Issue body actions

Describe the issue
I'm trying to do the same as the guy here #548.
Using FakeArduino native to unit test with platform io, where ArduinoJson is deeply integrated.
I already tried the fix from the issue there, but I suppose sth. changed, that makes it not work anymore, or I missed something.

Troubleshooter report
Here is the report generated by the ArduinoJson Troubleshooter:

ArduinoJson Troubleshooter's report
  1. The issue happens at compile time
  2. The error is not in the list

Environment
Here is the environment that I'm using':

  • Microconroller: NA
  • Core/runtime: NA
  • IDE: Platform IO and VS Code

Further information
platform.ini file content:

[env:native]
platform = native
test_ignore = embedded
build_flags = -std=gnu++11
lib_deps = 
	ArduinoJson-6.18.5
	ArduinoFake
#lib_archive = false 

Compile output:

lib/ArduinoJson-6.18.5/src/ArduinoJson/Polyfills/pgmspace_generic.hpp:14:10: error: reinterpret_cast from 'const void' to 'const __FlashStringHelper *' is not allowed
  return reinterpret_cast<T>(pgm_read_ptr(p));
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/ArduinoJson-6.18.5/src/ArduinoJson/Deserialization/DeserializationError.hpp:100:12: note: in instantiation of function template specialization 'ArduinoJson6185_F1::pgm_read<const __FlashStringHelper *>' requested here
    return ARDUINOJSON_READ_STATIC_ARRAY(const __FlashStringHelper*, messages,
           ^
lib/ArduinoJson-6.18.5/src/ArduinoJson/Polyfills/static_array.hpp:20:7: note: expanded from macro 'ARDUINOJSON_READ_STATIC_ARRAY'
      pgm_read<type>(name + index)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.