@@ -26,6 +26,8 @@ func ptrValue[T any](value T) *T {
2626
2727func TestSetGetItem (t * testing.T ) {
2828 t .Parallel ()
29+ t .Cleanup (MaybeDoLeakCheck )
30+ t .Cleanup (MaybeDoLeakCheck )
2931
3032 testCases := map [string ]struct {
3133 item pam.Item
@@ -67,6 +69,7 @@ func TestSetGetItem(t *testing.T) {
6769 tc := tc
6870 t .Run (name , func (t * testing.T ) {
6971 t .Parallel ()
72+ t .Cleanup (MaybeDoLeakCheck )
7073
7174 require .True (t , tc .value != nil || tc .expectedValue != nil )
7275
@@ -88,6 +91,7 @@ func TestSetGetItem(t *testing.T) {
8891
8992func TestSetPutEnv (t * testing.T ) {
9093 t .Parallel ()
94+ t .Cleanup (MaybeDoLeakCheck )
9195
9296 testCases := map [string ]struct {
9397 env string
@@ -144,6 +148,7 @@ func TestSetPutEnv(t *testing.T) {
144148 tc := tc
145149 t .Run (name , func (t * testing.T ) {
146150 t .Parallel ()
151+ t .Cleanup (MaybeDoLeakCheck )
147152
148153 require .False (t , tc .skipPut && tc .expectedValue == nil )
149154
@@ -202,6 +207,7 @@ func TestSetPutEnv(t *testing.T) {
202207
203208func TestSetGetData (t * testing.T ) {
204209 t .Parallel ()
210+ t .Cleanup (MaybeDoLeakCheck )
205211
206212 testCases := map [string ]struct {
207213 key string
@@ -251,6 +257,7 @@ func TestSetGetData(t *testing.T) {
251257 tc := tc
252258 t .Run (name , func (t * testing.T ) {
253259 t .Parallel ()
260+ t .Cleanup (MaybeDoLeakCheck )
254261
255262 require .False (t , tc .skipGet && tc .skipSet )
256263
@@ -279,6 +286,7 @@ func TestSetGetData(t *testing.T) {
279286
280287func TestGetUser (t * testing.T ) {
281288 t .Parallel ()
289+ t .Cleanup (MaybeDoLeakCheck )
282290
283291 testCases := map [string ]struct {
284292 presetUser string
@@ -324,6 +332,7 @@ func TestGetUser(t *testing.T) {
324332 tc := tc
325333 t .Run (name , func (t * testing.T ) {
326334 t .Parallel ()
335+ t .Cleanup (MaybeDoLeakCheck )
327336
328337 tx := NewModuleTransactionDummy (tc .convHandler )
329338
@@ -342,6 +351,7 @@ func TestGetUser(t *testing.T) {
342351
343352func TestStartStringConv (t * testing.T ) {
344353 t .Parallel ()
354+ t .Cleanup (MaybeDoLeakCheck )
345355
346356 testCases := map [string ]struct {
347357 prompt string
@@ -392,6 +402,7 @@ func TestStartStringConv(t *testing.T) {
392402 tc := tc
393403 t .Run (name , func (t * testing.T ) {
394404 t .Parallel ()
405+ t .Cleanup (MaybeDoLeakCheck )
395406
396407 convFunCalled := false
397408 tx := NewModuleTransactionDummy (func () pam.ConversationFunc {
@@ -438,6 +449,7 @@ func TestStartStringConv(t *testing.T) {
438449
439450func TestStartBinaryConv (t * testing.T ) {
440451 t .Parallel ()
452+ t .Cleanup (MaybeDoLeakCheck )
441453
442454 testCases := map [string ]struct {
443455 request []byte
@@ -467,6 +479,7 @@ func TestStartBinaryConv(t *testing.T) {
467479 tc := tc
468480 t .Run (name , func (t * testing.T ) {
469481 t .Parallel ()
482+ t .Cleanup (MaybeDoLeakCheck )
470483
471484 convFunCalled := false
472485 var tx pam.ModuleTransaction
0 commit comments