mirror of
https://github.com/esphome/esphome.git
synced 2026-02-28 09:54:19 -07:00
Use DEBUG guard for asserts instead of custom define
Integration tests already pass -DDEBUG, so no custom define needed.
This commit is contained in:
@@ -105,7 +105,7 @@ class ProtoVarInt {
|
||||
|
||||
/// Parse a varint from buffer. consumed must be a valid pointer (not null).
|
||||
static optional<ProtoVarInt> parse(const uint8_t *buffer, uint32_t len, uint32_t *consumed) {
|
||||
#ifdef ESPHOME_DEBUG_API
|
||||
#ifdef DEBUG
|
||||
assert(consumed != nullptr);
|
||||
#endif
|
||||
if (len == 0)
|
||||
@@ -922,7 +922,7 @@ inline void ProtoWriteBuffer::encode_message(uint32_t field_id, const ProtoMessa
|
||||
// Now encode the message content - it will append to the buffer
|
||||
value.encode(*this);
|
||||
|
||||
#ifdef ESPHOME_DEBUG_API
|
||||
#ifdef DEBUG
|
||||
// Verify that the encoded size matches what we calculated
|
||||
assert(this->buffer_->size() == begin + varint_length_bytes + msg_length_bytes);
|
||||
#endif
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#define ESPHOME_PROJECT_VERSION_30 "v2"
|
||||
#define ESPHOME_VARIANT "ESP32"
|
||||
#define ESPHOME_DEBUG_SCHEDULER
|
||||
#define ESPHOME_DEBUG_API
|
||||
|
||||
// Default threading model for static analysis (ESP32 is multi-threaded with atomics)
|
||||
#define ESPHOME_THREAD_MULTI_ATOMICS
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
esphome:
|
||||
platformio_options:
|
||||
build_flags:
|
||||
- -DESPHOME_DEBUG_API
|
||||
on_boot:
|
||||
then:
|
||||
- wait_until:
|
||||
|
||||
Reference in New Issue
Block a user