vulkaninfo: add more asserts to catch bad formatting
authorCharles Giessen <charles@lunarg.com>
Thu, 18 Jun 2020 23:20:15 +0000 (17:20 -0600)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Fri, 19 Jun 2020 15:26:44 +0000 (09:26 -0600)
Change-Id: I923e6fee647edf40d1720ce5f1736b2672059b71

vulkaninfo/outputprinter.h

index edcb8cb..ee3078b 100644 (file)
@@ -430,6 +430,7 @@ class Printer {
                 }
                 out << std::string(static_cast<size_t>(indents), '\t') << "\"" << array_name << "\": "
                     << "[\n";
+                assert(is_array.top() == false && "Cant start an array object inside another array, must be enclosed in an object");
                 is_first_item.push(true);
                 is_array.push(true);
                 break;