403Webshell
Server IP : 217.160.0.212  /  Your IP : 216.73.216.141
Web Server : Apache
System : Linux www 6.18.51-i1-ampere #1196 SMP Fri Sep 11 20:43:55 CEST 2026 aarch64
User : sws1073854427 ( 1073854427)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/go/src/cmd/cgo/internal/test/issue9026/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/go/src/cmd/cgo/internal/test/issue9026/issue9026.go
// Copyright 2014 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 issue9026

// This file appears in its own package since the assertion tests the
// per-package counter used to create fresh identifiers.

/*
typedef struct { int i; } git_merge_file_input;

typedef struct { int j; } git_merge_file_options;

void git_merge_file(
        git_merge_file_input *in,
        git_merge_file_options *opts) {}
*/
import "C"
import (
	"fmt"
	"testing"
)

func Test(t *testing.T) {
	var in C.git_merge_file_input
	var opts *C.git_merge_file_options
	C.git_merge_file(&in, opts)

	// Test that the generated type names are deterministic.
	// (Previously this would fail about 10% of the time.)
	//
	// Brittle: the assertion may fail spuriously when the algorithm
	// changes, but should remain stable otherwise.
	got := fmt.Sprintf("%T %T", in, opts)
	want := "issue9026._Ctype_struct___0 *issue9026._Ctype_struct___1"
	if got != want {
		t.Errorf("Non-deterministic type names: got %s, want %s", got, want)
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit