Skip to content

fix-tests: missing def for strlen_P & python libs#4

Merged
hmueller01 merged 1 commit intohmueller01:masterfrom
abdosn:master
Feb 20, 2025
Merged

fix-tests: missing def for strlen_P & python libs#4
hmueller01 merged 1 commit intohmueller01:masterfrom
abdosn:master

Conversation

@abdosn
Copy link
Copy Markdown
Collaborator

@abdosn abdosn commented Feb 20, 2025

chagnes

  • Added macro for strlen_P
  • Modify deprecated python lib mosquitto to paho.mqtt

@hmueller01 hmueller01 merged commit d4452ad into hmueller01:master Feb 20, 2025
@hmueller01
Copy link
Copy Markdown
Owner

I was a little bit quick with merging ... :-)
Wanted to test the updates. Can you tell me how the tests are triggered?

@abdosn
Copy link
Copy Markdown
Collaborator Author

abdosn commented Feb 20, 2025

according to This readme

the local tests could be build

cd tests
make
make test

this will run all tests
it would be nice if this would implemented in a workflow

Python tests had a problem with ino tool ,, didn't try it yet

@hmueller01
Copy link
Copy Markdown
Owner

make results in

In file included from src/connect_spec.cpp:1:
../src/PubSubClient.h:146:5: error: no template named 'function' in namespace 'std'
  146 |     MQTT_CALLBACK_SIGNATURE;
      |     ^~~~~~~~~~~~~~~~~~~~~~~

on macOS. Does it compile on your computer?

After adding -std=c++11 this part compiles.
Created a branch for this:
https://github.com/hmueller01/pubsubclient3/tree/fix-test-compile
Can you try it, if this works on your computer as well?

But still got errors at

g++ -std=c++11 -I./src/lib -I../src src/receive_spec.cpp ../src/PubSubClient.cpp src/lib/BDDTest.cpp src/lib/Buffer.cpp src/lib/IPAddress.cpp src/lib/ShimClient.cpp src/lib/Stream.cpp -o bin/receive_spec
src/receive_spec.cpp:115:28: error: non-constant-expression cannot be narrowed from type 'int' to 'byte' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
  115 |     byte publish[] = {0x30,length-2,0x0,0x5,0x74,0x6f,0x70,0x69,0x63,0x70,0x61,0x79,0x6c,0x6f,0x61,0x64};
      |                            ^~~~~~~~
src/receive_spec.cpp:115:28: note: insert an explicit cast to silence this issue
  115 |     byte publish[] = {0x30,length-2,0x0,0x5,0x74,0x6f,0x70,0x69,0x63,0x70,0x61,0x79,0x6c,0x6f,0x61,0x64};
      |                            ^~~~~~~~
      |                            static_cast<byte>( )

Have to look into this tomorrow ...

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.

2 participants