@@ -818,6 +818,7 @@ void PipelineHandler::dumpConfiguration(const std::set<const Stream *> &streams,
/* \todo Dump Sensor configuration */
YamlList streamsList = configurationDict.list("streams");
+ YamlList thatsanono = configurationDict.list("shouldntbehere");
for (const auto &stream : streams) {
const StreamConfiguration &streamConfig = stream->configuration();
@@ -561,12 +561,7 @@ YamlList::~YamlList()
*/
YamlList YamlList::list()
{
- if (!parent_) {
- LOG(YamlEmitter, Error)
- << "Invalid usage of the YamlEmitter API. "
- << " The YAML output might not be correct.";
- return {};
- }
+ ASSERT(parent_);
int ret = emitSequenceStart();
if (ret)
@@ -580,12 +575,7 @@ YamlList YamlList::list()
*/
YamlDict YamlList::dict()
{
- if (!parent_) {
- LOG(YamlEmitter, Error)
- << "Invalid usage of the YamlEmitter API. "
- << " The YAML output might not be correct.";
- return {};
- }
+ ASSERT(parent_);
int ret = emitMappingStart();
if (ret)
@@ -600,12 +590,7 @@ YamlDict YamlList::dict()
*/
void YamlList::scalar(std::string_view scalar)
{
- if (!parent_) {
- LOG(YamlEmitter, Error)
- << "Invalid usage of the YamlEmitter API. "
- << " The YAML output might not be correct.";
- return;
- }
+ ASSERT(parent_);
emitScalar(scalar);
}
@@ -652,12 +637,7 @@ YamlDict::~YamlDict()
*/
YamlList YamlDict::list(std::string_view key)
{
- if (!parent_) {
- LOG(YamlEmitter, Error)
- << "Invalid usage of the YamlEmitter API. "
- << " The YAML output might not be correct.";
- return {};
- }
+ ASSERT(parent_);
int ret = emitScalar(key);
if (ret)
@@ -677,12 +657,7 @@ YamlList YamlDict::list(std::string_view key)
*/
YamlDict YamlDict::dict(std::string_view key)
{
- if (!parent_) {
- LOG(YamlEmitter, Error)
- << "Invalid usage of the YamlEmitter API. "
- << " The YAML output might not be correct.";
- return {};
- }
+ ASSERT(parent_);
int ret = emitScalar(key);
if (ret)
@@ -702,12 +677,7 @@ YamlDict YamlDict::dict(std::string_view key)
*/
void YamlDict::scalar(std::string_view key, std::string_view scalar)
{
- if (!parent_) {
- LOG(YamlEmitter, Error)
- << "Invalid usage of the YamlEmitter API. "
- << " The YAML output might not be correct.";
- return;
- }
+ ASSERT(parent_);
int ret = emitScalar(key);
if (ret)
Break the pipeline handler with an invalid API usage sequence in pipeline_handler.cpp ASSERT() for the presence of a valid parent_ reference in the YamlOutput class hierarcy to trigger a visible error to users. FATAL default yaml_emitter.cpp:578 assertion "parent_" failed in dict() Backtrace: libcamera::YamlList::dict()+0xb4 (../src/libcamera/yaml_emitter.cpp:580) Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> --- src/libcamera/pipeline_handler.cpp | 1 + src/libcamera/yaml_emitter.cpp | 42 +++++------------------------- 2 files changed, 7 insertions(+), 36 deletions(-)