| 23 | } |
| 24 | |
| 25 | int main(int argc, char **argv) |
| 26 | { |
| 27 | MyStruct *myStruct = new MyStruct(); |
| 28 | |
| 29 | |
| 30 | if (!checkAttachNone("before creation")) |
| 31 | return -1; |
| 32 | |
| 33 | { |
| 34 | hx::NativeAttach autoAttach; |
| 35 | const char *err = hx::Init(false); |
| 36 | if (err) |
| 37 | { |
| 38 | printf("Could not initialize library: %s\n", err); |
| 39 | return -1; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | |
| 44 | if (!checkAttachNone("after init")) |
| 45 | return -1; |
| 46 | |
| 47 | { |
| 48 | hx::NativeAttach autoAttach; |
| 49 | |
| 50 | api::HaxeObject *obj = api::HaxeApi::createBase(); |
| 51 | obj->setName("child"); |
| 52 | |
| 53 | myStruct->haxeRef = obj; |
| 54 | obj->setName("Name"); |
| 55 | |
| 56 | api::HaxeObject *child = obj->createChild(); |
| 57 | } |
| 58 | |
| 59 | |
| 60 | if (!checkAttachNone("after interaction")) |
| 61 | return -1; |
| 62 | |
| 63 | { |
| 64 | hx::NativeAttach autoAttach; |
| 65 | __hxcpp_collect(true); |
| 66 | } |
| 67 | |
| 68 | if (!checkAttachNone("after collect")) |
| 69 | return -1; |
| 70 | |
| 71 | { |
| 72 | hx::NativeAttach autoAttach; |
| 73 | if (myStruct->haxeRef->getName()!="Name") |
| 74 | { |
| 75 | printf("Could not get value back (%s)\n", myStruct->haxeRef->getName().c_str() ); |
| 76 | return -1; |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | { |
| 81 | hx::NativeAttach autoAttach0; |
| 82 | hx::NativeAttach autoAttach1; |
nothing calls this directly
no test coverage detected