Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for WriteSeeker (0.2 sec)

  1. src/internal/coverage/slicewriter/slicewriter.go

    package slicewriter
    
    import (
    	"fmt"
    	"io"
    )
    
    // WriteSeeker is a helper object that implements the io.WriteSeeker
    // interface. Clients can create a WriteSeeker, make a series of Write
    // calls to add data to it (and possibly Seek calls to update
    // previously written portions), then finally invoke BytesWritten() to
    // get a pointer to the constructed byte slice.
    type WriteSeeker struct {
    	payload []byte
    	off     int64
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 26 12:44:26 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  2. src/internal/coverage/slicewriter/slw_test.go

    			}
    		}
    	}
    
    	wf := func(t *testing.T, ws *WriteSeeker, p []byte) {
    		t.Helper()
    		nw, werr := ws.Write(p)
    		if werr != nil {
    			t.Fatalf("unexpected write error: %v", werr)
    		}
    		if nw != len(p) {
    			t.Fatalf("wrong amount written want %d got %d", len(p), nw)
    		}
    	}
    
    	rf := func(t *testing.T, ws *WriteSeeker, p []byte) {
    		t.Helper()
    		b := make([]byte, len(p))
    		nr, rerr := ws.Read(b)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 26 12:44:26 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  3. src/internal/coverage/encodecounter/encode.go

    	if err := cfw.writeHeader(metaFileHash); err != nil {
    		return err
    	}
    	return cfw.AppendSegment(args, visitor)
    }
    
    func padToFourByteBoundary(ws *slicewriter.WriteSeeker) error {
    	sz := len(ws.BytesWritten())
    	zeros := []byte{0, 0, 0, 0}
    	rem := uint32(sz) % 4
    	if rem != 0 {
    		pad := zeros[:(4 - rem)]
    		if nw, err := ws.Write(pad); err != nil {
    			return err
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  4. src/internal/coverage/cfile/testdata/harness.go

    	log.SetPrefix("emitToWriter: ")
    	var slwm slicewriter.WriteSeeker
    	if err := coverage.WriteMeta(&slwm); err != nil {
    		log.Fatalf("error: WriteMeta returns %v", err)
    	}
    	mf := filepath.Join(*outdirflag, "covmeta.0abcdef")
    	if err := os.WriteFile(mf, slwm.BytesWritten(), 0666); err != nil {
    		log.Fatalf("error: writing %s: %v", mf, err)
    	}
    	var slwc slicewriter.WriteSeeker
    	if err := coverage.WriteCounters(&slwc); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 21 19:41:02 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  5. src/internal/coverage/encodemeta/encode.go

    	nFuncs := len(b.funcs)
    	var foff int64 = coverage.CovMetaHeaderSize + int64(b.stab.Size()) + int64(nFuncs)*4
    	for idx := 0; idx < nFuncs; idx++ {
    		b.wrUint32(w, uint32(foff))
    		foff += int64(len(b.funcs[idx].encoded))
    	}
    	return off + (int64(len(b.funcs)) * 4)
    }
    
    func (b *CoverageMetaDataBuilder) emitFunc(w io.WriteSeeker, off int64, f funcDesc) (int64, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 29 17:16:10 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  6. src/internal/coverage/test/roundtrip_test.go

    	p := "empty/package"
    	pn := "package"
    	mp := "m"
    	b, err := encodemeta.NewCoverageMetaDataBuilder(p, pn, mp)
    	if err != nil {
    		t.Fatalf("making builder: %v", err)
    	}
    	drws := &slicewriter.WriteSeeker{}
    	b.Emit(drws)
    	drws.Seek(0, io.SeekStart)
    	dec, err := decodemeta.NewCoverageMetaDataDecoder(drws.BytesWritten(), false)
    	if err != nil {
    		t.Fatalf("making decoder: %v", err)
    	}
    	nf := dec.NumFuncs()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 20 21:42:05 UTC 2023
    - 8.5K bytes
    - Viewed (0)
Back to top