summaryrefslogtreecommitdiff
path: root/src/pkg/gob/codec_test.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2009-07-17 11:38:31 -0700
committerRob Pike <r@golang.org>2009-07-17 11:38:31 -0700
commit9148fc15b5209d500735f4ead17ac77c5d4c6f4f (patch)
tree683aa2a5d868f3c384b7fb25aea2f1180b153784 /src/pkg/gob/codec_test.go
parentee82556e6ebb36158573fb7ced8b8b850c8200c9 (diff)
downloadgolang-9148fc15b5209d500735f4ead17ac77c5d4c6f4f.tar.gz
ignore missing structs
R=rsc DELTA=113 (74 added, 14 deleted, 25 changed) OCL=31776 CL=31776
Diffstat (limited to 'src/pkg/gob/codec_test.go')
-rw-r--r--src/pkg/gob/codec_test.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pkg/gob/codec_test.go b/src/pkg/gob/codec_test.go
index 294506589..de2c5d6bc 100644
--- a/src/pkg/gob/codec_test.go
+++ b/src/pkg/gob/codec_test.go
@@ -703,6 +703,7 @@ type IT0 struct {
ignore_f bool;
ignore_g string;
ignore_h []byte;
+ ignore_i *RT1;
c float;
}
@@ -718,13 +719,17 @@ func TestIgnoredFields(t *testing.T) {
it0.ignore_f = true;
it0.ignore_g = "pay no attention";
it0.ignore_h = strings.Bytes("to the curtain");
+ it0.ignore_i = &RT1{ 3.1, "hi", 7, "hello" };
b := new(bytes.Buffer);
encode(b, it0);
rt0Id := getTypeInfo(reflect.Typeof(it0)).typeId;
var rt1 RT1;
// Wire type is IT0, local type is RT1.
- decode(b, rt0Id, &rt1);
+ err := decode(b, rt0Id, &rt1);
+ if err != nil {
+ t.Error("error: ", err);
+ }
if int(it0.a) != rt1.a || it0.b != rt1.b || it0.c != rt1.c {
t.Errorf("rt1->rt0: expected %v; got %v", it0, rt1);
}