(t *testing.T)
| 225 | } |
| 226 | |
| 227 | func TestBridgeMappingCloseContractStress(t *testing.T) { |
| 228 | for i := 0; i < 64; i++ { |
| 229 | rt := NewRuntime() |
| 230 | ctx := rt.NewContext() |
| 231 | require.NotNil(t, ctx) |
| 232 | |
| 233 | ctxRef := ctx.ref |
| 234 | rtRef := rt.ref |
| 235 | |
| 236 | require.NotNil(t, getContextFromJS(ctxRef)) |
| 237 | require.NotNil(t, getRuntimeFromJS(rtRef)) |
| 238 | |
| 239 | for j := 0; j < 32; j++ { |
| 240 | unregisterContext(ctxRef) |
| 241 | require.Nil(t, getContextFromJS(ctxRef)) |
| 242 | registerContext(ctxRef, ctx) |
| 243 | require.NotNil(t, getContextFromJS(ctxRef)) |
| 244 | } |
| 245 | |
| 246 | ctx.Close() |
| 247 | rt.Close() |
| 248 | |
| 249 | contextMapping.Store(ctxRef, ctx) |
| 250 | runtimeMapping.Store(rtRef, rt) |
| 251 | |
| 252 | require.Nil(t, getContextFromJS(ctxRef)) |
| 253 | require.Nil(t, getRuntimeFromJS(rtRef)) |
| 254 | require.NotPanics(t, func() { |
| 255 | _ = goInterruptHandler(rtRef) |
| 256 | }) |
| 257 | |
| 258 | contextMapping.Delete(ctxRef) |
| 259 | runtimeMapping.Delete(rtRef) |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | func TestBridgeNilCallbackResultsNormalizeToUndefined(t *testing.T) { |
| 264 | rt := NewRuntime() |
nothing calls this directly
no test coverage detected