Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for byteSliceRemoveBytes (0.26 sec)

  1. src/internal/fuzz/mutators_byteslice_test.go

    	for _, tc := range []struct {
    		name     string
    		mutator  func(*mutator, []byte) []byte
    		randVals []int
    		input    []byte
    		expected []byte
    	}{
    		{
    			name:     "byteSliceRemoveBytes",
    			mutator:  byteSliceRemoveBytes,
    			input:    []byte{1, 2, 3, 4},
    			expected: []byte{4},
    		},
    		{
    			name:     "byteSliceInsertRandomBytes",
    			mutator:  byteSliceInsertRandomBytes,
    			input:    make([]byte, 4, 8),
    Registered: 2024-06-12 16:32
    - Last Modified: 2021-11-19 18:23
    - 4.3K bytes
    - Viewed (0)
  2. src/internal/fuzz/mutators_byteslice.go

    // Copyright 2021 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package fuzz
    
    // byteSliceRemoveBytes removes a random chunk of bytes from b.
    func byteSliceRemoveBytes(m *mutator, b []byte) []byte {
    	if len(b) <= 1 {
    		return nil
    	}
    	pos0 := m.rand(len(b))
    	pos1 := pos0 + m.chooseLen(len(b)-pos0)
    	copy(b[pos0:], b[pos1:])
    	b = b[:len(b)-(pos1-pos0)]
    Registered: 2024-06-12 16:32
    - Last Modified: 2021-11-19 18:23
    - 7.7K bytes
    - Viewed (0)
  3. src/internal/fuzz/mutator.go

    				continue
    			}
    			v /= float64(1 + m.rand(10))
    			return v
    		}
    	}
    }
    
    type byteSliceMutator func(*mutator, []byte) []byte
    
    var byteSliceMutators = []byteSliceMutator{
    	byteSliceRemoveBytes,
    	byteSliceInsertRandomBytes,
    	byteSliceDuplicateBytes,
    	byteSliceOverwriteBytes,
    	byteSliceBitFlip,
    	byteSliceXORByte,
    	byteSliceSwapByte,
    	byteSliceArithmeticUint8,
    	byteSliceArithmeticUint16,
    Registered: 2024-06-12 16:32
    - Last Modified: 2023-09-18 20:01
    - 6.6K bytes
    - Viewed (0)
Back to top