(t *testing.T)
| 1390 | } |
| 1391 | |
| 1392 | func TestRuntimeContextBootstrapOwnerDenied(t *testing.T) { |
| 1393 | oldGIDHook := ownerCheckCurrentGoroutineID |
| 1394 | oldThreadHook := ownerCheckCurrentThreadID |
| 1395 | defer func() { |
| 1396 | ownerCheckCurrentGoroutineID = oldGIDHook |
| 1397 | ownerCheckCurrentThreadID = oldThreadHook |
| 1398 | }() |
| 1399 | |
| 1400 | var gid atomic.Uint64 |
| 1401 | gid.Store(71) |
| 1402 | ownerCheckCurrentGoroutineID = func() uint64 { return gid.Load() } |
| 1403 | ownerCheckCurrentThreadID = func() uint64 { return 1 } |
| 1404 | |
| 1405 | rt := NewRuntime() |
| 1406 | defer rt.Close() |
| 1407 | |
| 1408 | ctx := rt.NewBareContext() |
| 1409 | require.NotNil(t, ctx) |
| 1410 | |
| 1411 | gid.Store(72) |
| 1412 | require.False(t, ctx.BootstrapStdOS()) |
| 1413 | require.False(t, ctx.BootstrapTimers()) |
| 1414 | |
| 1415 | gid.Store(71) |
| 1416 | ctx.Close() |
| 1417 | } |
| 1418 | |
| 1419 | func TestRuntimeContextBootstrapHooks(t *testing.T) { |
| 1420 | oldStdOSHook := runtimeBootstrapStdOSHook |
nothing calls this directly
no test coverage detected