Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 17 of 17 for TestBytes (0.23 sec)

  1. test/makeslice.go

    func main() {
    	n := -1
    	testInts(uint64(n))
    	testBytes(uint64(n))
    
    	var t *byte
    	if unsafe.Sizeof(t) == 8 {
    		// Test mem > maxAlloc
    		testInts(1 << 59)
    
    		// Test elem.size*cap overflow
    		testInts(1<<63 - 1)
    
    		testInts(1<<64 - 1)
    		testBytes(1<<64 - 1)
    	} else {
    		testInts(1<<31 - 1)
    
    		// Test elem.size*cap overflow
    		testInts(1<<32 - 1)
    		testBytes(1<<32 - 1)
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 07 17:50:24 UTC 2020
    - 5.5K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java

    import java.util.Random;
    import junit.framework.TestCase;
    
    /**
     * Tests for AbstractByteHasher.
     *
     * @author Colin Decker
     */
    public class AbstractByteHasherTest extends TestCase {
    
      public void testBytes() {
        TestHasher hasher = new TestHasher(); // byte order insignificant here
        byte[] expected = {1, 2, 3, 4, 5, 6, 7, 8};
        hasher.putByte((byte) 1);
        hasher.putBytes(new byte[] {2, 3, 4, 5, 6});
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java

    import java.util.Random;
    import junit.framework.TestCase;
    
    /**
     * Tests for AbstractStreamingHasher.
     *
     * @author Dimitris Andreou
     */
    public class AbstractStreamingHasherTest extends TestCase {
      public void testBytes() {
        Sink sink = new Sink(4); // byte order insignificant here
        byte[] expected = {1, 2, 3, 4, 5, 6, 7, 8};
        sink.putByte((byte) 1);
        sink.putBytes(new byte[] {2, 3, 4, 5, 6});
        sink.putByte((byte) 7);
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 8.5K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java

    import java.util.Random;
    import junit.framework.TestCase;
    
    /**
     * Tests for AbstractStreamingHasher.
     *
     * @author Dimitris Andreou
     */
    public class AbstractStreamingHasherTest extends TestCase {
      public void testBytes() {
        Sink sink = new Sink(4); // byte order insignificant here
        byte[] expected = {1, 2, 3, 4, 5, 6, 7, 8};
        sink.putByte((byte) 1);
        sink.putBytes(new byte[] {2, 3, 4, 5, 6});
        sink.putByte((byte) 7);
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 8.5K bytes
    - Viewed (0)
  5. src/go/constant/value_test.go

    		}
    	}
    }
    
    var bytesTests = []string{
    	"0",
    	"1",
    	"123456789",
    	"123456789012345678901234567890123456789012345678901234567890",
    }
    
    func TestBytes(t *testing.T) {
    	for _, test := range bytesTests {
    		x := val(test)
    		bytes := Bytes(x)
    
    		// special case 0
    		if Sign(x) == 0 && len(bytes) != 0 {
    			t.Errorf("%s: got %v; want empty byte slice", test, bytes)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 15.6K bytes
    - Viewed (0)
  6. src/math/big/int_test.go

    	// trim leading zero bytes since Bytes() won't return them
    	// (was issue 12231)
    	for len(b) > 0 && b[0] == 0 {
    		b = b[1:]
    	}
    	b2 := new(Int).SetBytes(b).Bytes()
    	return bytes.Equal(b, b2)
    }
    
    func TestBytes(t *testing.T) {
    	if err := quick.Check(checkBytes, nil); err != nil {
    		t.Error(err)
    	}
    }
    
    func checkQuo(x, y []byte) bool {
    	u := new(Int).SetBytes(x)
    	v := new(Int).SetBytes(y)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 58.5K bytes
    - Viewed (0)
  7. src/reflect/all_test.go

    	for _, tt := range tagGetTests {
    		if v := tt.Tag.Get(tt.Key); v != tt.Value {
    			t.Errorf("StructTag(%#q).Get(%#q) = %#q, want %#q", tt.Tag, tt.Key, v, tt.Value)
    		}
    	}
    }
    
    func TestBytes(t *testing.T) {
    	shouldPanic("on int Value", func() { ValueOf(0).Bytes() })
    	shouldPanic("of non-byte slice", func() { ValueOf([]string{}).Bytes() })
    
    	type S []byte
    	x := S{1, 2, 3, 4}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
Back to top