From fa8fd85f5c451648bb7cfbe275db19efa921d850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Sun, 18 May 2014 11:49:13 +0200 Subject: Sluift: Add assertions on conversion Change-Id: I641380fe7423af7b2c7be992f59244a57fb24b51 diff --git a/Sluift/ElementConvertors/CommandConvertor.cpp b/Sluift/ElementConvertors/CommandConvertor.cpp index 7fb7b22..9a2aa5f 100644 --- a/Sluift/ElementConvertors/CommandConvertor.cpp +++ b/Sluift/ElementConvertors/CommandConvertor.cpp @@ -189,7 +189,8 @@ void CommandConvertor::doConvertToLua(lua_State* L, boost::shared_ptr p Lua::pushValue(L, result); if (payload->getForm()) { - convertors->convertToLuaUntyped(L, payload->getForm()); + bool result = convertors->convertToLuaUntyped(L, payload->getForm()); + assert(result); lua_setfield(L, -2, "form"); } } diff --git a/Sluift/Response.cpp b/Sluift/Response.cpp index 519379c..5c36a8e 100644 --- a/Sluift/Response.cpp +++ b/Sluift/Response.cpp @@ -59,13 +59,15 @@ int Response::convertToLuaResult(lua_State* L) { if (error) { lua_pushnil(L); lua_pushstring(L, getErrorString(error).c_str()); - Sluift::globals.elementConvertor.convertToLuaUntyped(L, error); + bool converted = Sluift::globals.elementConvertor.convertToLuaUntyped(L, error); + assert(converted); Lua::registerTableToString(L, -1); return 3; } else { if (result) { - Sluift::globals.elementConvertor.convertToLuaUntyped(L, result); + bool converted = Sluift::globals.elementConvertor.convertToLuaUntyped(L, result); + assert(converted); Lua::registerTableToString(L, -1); } else { -- cgit v0.10.2-6-g49f6