package ptttype

import (
	"sync"
	"testing"
)

func TestValidUSHMEntry(t *testing.T) {
	type args struct {
		x UtmpID
	}
	tests := []struct {
		name     string
		args     args
		expected bool
	}{
		// TODO: Add test cases.
		{
			args:     args{x: -1},
			expected: false,
		},
		{
			args:     args{x: 0},
			expected: true,
		},
		{
			args:     args{x: USHM_SIZE - 1},
			expected: true,
		},
		{
			args:     args{x: USHM_SIZE},
			expected: false,
		},
		{
			args:     args{x: USHM_SIZE + 1},
			expected: false,
		},
	}
	var wg sync.WaitGroup
	for _, tt := range tests {
		wg.Add(1)
		t.Run(tt.name, func(t *testing.T) {
			defer wg.Done()
			if got := ValidUSHMEntry(tt.args.x); got != tt.expected {
				t.Errorf("ValidUSHMEntry() = %v, want %v", got, tt.expected)
			}
		})
	}
	wg.Wait()
}
