qmetaobjectbuilder: Add asserts to confirm validity
authorKent Hansen <kent.hansen@nokia.com>
Sun, 5 Feb 2012 21:38:56 +0000 (22:38 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 16 Feb 2012 00:56:43 +0000 (01:56 +0100)
commit10de7f77f4ff37899db57d08fbd2a2b0702d1ab0
treea87d7d7891a2d5e9f4f9825fc7e9c183793a6351
parentacb9537551afa46330edfcc1bbad27c15099b902
qmetaobjectbuilder: Add asserts to confirm validity

buildMetaObject() can operate in two "modes", based on whether a
buffer to write the meta-object into is passed or not. Add asserts
to make sure that the intermediate meta-data indexes are correct
in both "modes", and that the final size in "write mode" matches
the size that was computed in the preceding non-writing pass.

The asserts make it easier to catch obvious problems when changing
buildMetaObject() to generate a new meta-object revision.

Change-Id: Ief7c74e6f6fca836587e831b06072d6aa98c7193
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
src/corelib/kernel/qmetaobjectbuilder.cpp