// TestNewCustomUint32ForDuplicateIdMultipleThreads tests CustomUint32 for any duplicate id.
TestNewCustomUint32ForDuplicateIdMultipleThreads tests CustomUint32 for any duplicate id.
// TestNewCustomUint32ForDuplicateIdMultipleThreads tests CustomUint32 for any duplicate id .
func TestNewCustomUint32NonDuplicateIdMultipleThreads(t *testing.T) {
	t.Parallel()
	ids := make(chan uint32, 10_240)
	wg := &sync.WaitGroup{}
	wg.Add(10)
	for t := 0; t < 10; t++ {
		go func() {
			defer wg.Done()
			for i := uint32(0); i < 1024; i++ {
				id := Uint32(i, 0, &DefaultUint32Config)
				ids <- id
			}
		}()
	}
	wg.Wait()
	close(ids)
	seen := make(map[uint32]struct{})
	for i := range ids {
		if _, ok := seen[i]; !ok {
			seen[i] = struct{}{}
			continue
		}
		t.Error("Duplicate Id found: ", i)
		break
	}
}
func TestNewCustomUint32NonDuplicateIdMultipleThreads ( t * testing . T ) { t . Parallel ( ) ids := make ( chan uint32 , 10_240 ) wg := & sync . WaitGroup { } wg . Add ( 10 ) for t := 0 ; t < 10 ; t ++ { go func ( ) { defer wg . Done ( ) for i := uint32 ( 0 ) ; i < 1024 ; i ++ { id := Uint32 ( i , 0 , & DefaultUint32Config ) ids <- id } } ( ) } wg . Wait ( ) close ( ids ) seen := make ( map [ uint32 ] struct { } ) for i := range ids { if _ , ok := seen [ i ] ; ! ok { seen [ i ] = struct { } { } continue } t . Error ( " " , i ) break } }
TestNewCustomUint32ForDuplicateIdMultipleThreads tests CustomUint32 for any duplicate id.
TestNewCustomUint32ForDuplicateIdMultipleThreads tests CustomUint32 for any duplicate id .
// create config with default values //	c := NewUint32Config(defaultUint32ProcessBits, defaultUint32ServerBits, defaultUint32SequenceBits)