| 142 | } |
| 143 | |
| 144 | static void TestObject(LuaCpp::State &lua) { |
| 145 | Base base = { 1, 2, 3 }; |
| 146 | lua["TEST"]["base"].SetObj(base); |
| 147 | lua["TEST"]["base"].AddObjMembers(base, |
| 148 | "x", &Base::x, |
| 149 | "y", &Base::y, |
| 150 | "z", &Base::z |
| 151 | ); |
| 152 | lua("print('TEST.base:y() == ', TEST.base:y())"); |
| 153 | |
| 154 | lua("TEST.base.testfunc = function() print('hello') end"); |
| 155 | if (lua["TEST"]["base"]["testfunc"].IsFunction()) { |
| 156 | lua["TEST"]["base"]["testfunc"](); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | struct XXX { |
| 161 | int x; |
no test coverage detected