mirror of
https://github.com/esphome/esphome.git
synced 2026-09-17 01:58:39 +00:00
Add friend declaration for original_setup used by cpp unit tests
The cpp test framework renames setup() to original_setup() and replaces setup() with the gtest runner, so we need to friend both. Co-Authored-By: J. Nick Koston <nick@koston.org>
This commit is contained in:
co-authored by
J. Nick Koston
parent
73fd1d68d5
commit
e468db0fce
@@ -108,8 +108,9 @@ namespace esphome::socket {
|
||||
class Socket;
|
||||
} // namespace esphome::socket
|
||||
|
||||
// Forward declaration for friend access from codegen-generated setup()
|
||||
// Forward declarations for friend access from codegen-generated setup()
|
||||
void setup();
|
||||
void original_setup(); // Used by cpp unit tests which replace setup() with gtest runner
|
||||
|
||||
namespace esphome {
|
||||
|
||||
@@ -505,6 +506,7 @@ class Application {
|
||||
friend Component;
|
||||
friend class socket::Socket;
|
||||
friend void ::setup();
|
||||
friend void ::original_setup();
|
||||
|
||||
#ifdef USE_SOCKET_SELECT_SUPPORT
|
||||
/// Fast path for Socket::ready() via friendship - skips negative fd check.
|
||||
|
||||
Reference in New Issue
Block a user