mirror of
https://github.com/golang/go
synced 2024-11-11 20:50:23 -07:00
fix some tests. only 3 remain broken (complit, hilbert, initcomma).
leaving golden.out alone for now. R=ken DELTA=13 (0 added, 0 deleted, 13 changed) OCL=21682 CL=21682
This commit is contained in:
parent
c3077f7606
commit
61a7e44002
@ -17,7 +17,7 @@ type Vector struct {
|
||||
func New() *Vector {
|
||||
v := new(*Vector);
|
||||
v.nelem = 0;
|
||||
v.elem = new(*[10]Element);
|
||||
v.elem = new([10]Element);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ type T struct {
|
||||
func main() {
|
||||
var ta []*T;
|
||||
|
||||
ta = new(*[1]*T);
|
||||
ta = new([1]*T);
|
||||
ta[0] = nil;
|
||||
}
|
||||
/*
|
||||
|
@ -31,7 +31,7 @@ func (s *TStruct) field(i int) *TStruct {
|
||||
|
||||
func main() {
|
||||
v := new(*Vector);
|
||||
v.elem = new(*[10]Element);
|
||||
v.elem = new([10]Element);
|
||||
t := new(*TStruct);
|
||||
t.name = "hi";
|
||||
v.elem[0] = t;
|
||||
|
@ -20,7 +20,7 @@ func P(a []string) string {
|
||||
|
||||
func main() {
|
||||
m := new(map[string] []string);
|
||||
as := new(*[2]string);
|
||||
as := new([2]string);
|
||||
as[0] = "0";
|
||||
as[1] = "1";
|
||||
m["0"] = as;
|
||||
|
@ -13,5 +13,5 @@ var c = []int { 1 }
|
||||
func main() {
|
||||
if len(a) != 2 { panicln("len a", len(a)) }
|
||||
if len(b) != 5 { panicln("len b", len(b)) }
|
||||
if len(c) != 1 { panicln("len a", len(a)) }
|
||||
if len(c) != 1 { panicln("len a", len(c)) }
|
||||
}
|
||||
|
@ -96,10 +96,10 @@ func
|
||||
testpdpf1()
|
||||
{
|
||||
a := new(*[40]int);
|
||||
setpd(a);
|
||||
res(sumpd(a), 0, 40);
|
||||
setpd(*a);
|
||||
res(sumpd(*a), 0, 40);
|
||||
|
||||
b := a[5:30];
|
||||
b := (*a)[5:30];
|
||||
res(sumpd(b), 5, 30);
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ func Get() int
|
||||
c = peekc;
|
||||
peekc = -1;
|
||||
} else {
|
||||
c = convert(int, input[inputindex]);
|
||||
c = int(input[inputindex]);
|
||||
inputindex++;
|
||||
if c == '\n' {
|
||||
lineno = lineno + 1;
|
||||
@ -175,7 +175,7 @@ func NextToken()
|
||||
break;
|
||||
default:
|
||||
for i = 0; i < 100 - 1; { // sizeof tokenbuf - 1
|
||||
tokenbuf[i] = convert(byte, c);
|
||||
tokenbuf[i] = byte(c);
|
||||
i = i + 1;
|
||||
c = Get();
|
||||
if c == EOF {
|
||||
@ -252,7 +252,7 @@ func atoi() int // BUG: uses tokenbuf; should take argument
|
||||
{
|
||||
var v int = 0;
|
||||
for i := 0; i < tokenlen && '0' <= tokenbuf[i] && tokenbuf[i] <= '9'; i = i + 1 {
|
||||
v = 10 * v + convert(int, tokenbuf[i] - '0');
|
||||
v = 10 * v + int(tokenbuf[i] - '0');
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ main()
|
||||
z2[0] = 'a';
|
||||
z2[1] = 'b';
|
||||
z2[2] = 'c';
|
||||
c = string(z2);
|
||||
c = string(*z2);
|
||||
if c != "abc" {
|
||||
panic("create array pointer ", c);
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ func test1() {
|
||||
}
|
||||
|
||||
for i := 0; i < v.Len(); i++ {
|
||||
x := convert(*S, v.At(i));
|
||||
x := v.At(i).(*S);
|
||||
if x.val != v.Len() - i - 1 {
|
||||
panic("expected ", i, ", found ", x.val, "\n");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user