github.com/outcaste-io/sroar@v0.0.0-20221229172112-1fb64f14314c/utils_test.go (about)

     1  package sroar
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/require"
     7  )
     8  
     9  func TestMemclr(t *testing.T) {
    10  	b := [...]uint16{
    11  		3: 10000 + 1,
    12  		4: 10000 + 2,
    13  		5: 10000 + 3,
    14  		6: 10000 + 4,
    15  	}
    16  	t.Logf("%x", b)
    17  	Memclr(b[:])
    18  	for _, ui := range b {
    19  		require.Equal(t, uint16(0), ui)
    20  	}
    21  }