Skip to content

Commit cad9f89

Browse files
authored
Merge pull request #750 from billsegall/golang-fixes
[Golang] fixes for updated example
2 parents 027fe21 + 3ef72c9 commit cad9f89

File tree

6 files changed

+30
-335
lines changed

6 files changed

+30
-335
lines changed

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,6 @@ task generateGolangCodecsWithXSD(type: JavaExec) {
632632
'sbe-tool/src/test/resources/since-deprecated-test-schema.xml',
633633
'sbe-tool/src/test/resources/example-bigendian-test-schema.xml',
634634
'gocode/resources/example-composite.xml',
635-
'gocode/resources/example-extension-2-schema.xml',
636635
'gocode/resources/group-with-data-extension-schema.xml',
637636
'gocode/resources/simple.xml']
638637
}

gocode/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ src/baseline/SbeMarshalling.go: $(DEP)
5959
# they geenrate into the same directory but golang doesn't allow that
6060
test: $(DEP)
6161
(export GOPATH=$(GOPATH) && \
62-
(for t in baseline extension extension2; do \
62+
(for t in baseline extension; do \
6363
export GOPATH=$(GOPATH) && \
6464
cd $(GOPATH)/src/$$t && \
6565
go build && \

gocode/resources/example-extension-2-schema.xml

Lines changed: 0 additions & 94 deletions
This file was deleted.

gocode/src/baseline/Car_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestEncodeDecodeCar(t *testing.T) {
4545
pf = append(pf, CarPerformanceFigures{95, acc1})
4646
pf = append(pf, CarPerformanceFigures{99, acc2})
4747

48-
in := Car{1234, 2013, BooleanType.T, Model.A, [5]uint32{0, 1, 2, 3, 4}, vehicleCode, optionalExtras, Model.A, engine, fuel, pf, manufacturer, model, activationCode}
48+
in := Car{1234, 2013, BooleanType.T, Model.A, [4]uint32{0, 1, 2, 3}, vehicleCode, optionalExtras, Model.A, engine, fuel, pf, manufacturer, model, activationCode}
4949

5050
var buf = new(bytes.Buffer)
5151
if err := in.Encode(m, buf, true); err != nil {
@@ -112,10 +112,8 @@ func TestEncodeDecodeCar(t *testing.T) {
112112
}
113113

114114
func TestDecodeJavaBuffer(t *testing.T) {
115-
116-
// The byte array is from the java example for interop test made by
117-
// running with -Dsbe.encoding.filename and then decoded using od -tu1
118-
data := []byte{49, 0, 1, 0, 1, 0, 0, 0, 210, 4, 0, 0, 0, 0, 0, 0, 221, 7, 1, 65, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 97, 98, 99, 100, 101, 102, 6, 208, 7, 4, 49, 50, 51, 35, 1, 78, 200, 6, 0, 3, 0, 30, 0, 154, 153, 15, 66, 11, 0, 0, 0, 85, 114, 98, 97, 110, 32, 67, 121, 99, 108, 101, 55, 0, 0, 0, 68, 66, 14, 0, 0, 0, 67, 111, 109, 98, 105, 110, 101, 100, 32, 67, 121, 99, 108, 101, 75, 0, 0, 0, 32, 66, 13, 0, 0, 0, 72, 105, 103, 104, 119, 97, 121, 32, 67, 121, 99, 108, 101, 1, 0, 2, 0, 95, 6, 0, 3, 0, 30, 0, 0, 0, 128, 64, 60, 0, 0, 0, 240, 64, 100, 0, 51, 51, 67, 65, 99, 6, 0, 3, 0, 30, 0, 51, 51, 115, 64, 60, 0, 51, 51, 227, 64, 100, 0, 205, 204, 60, 65, 5, 0, 0, 0, 72, 111, 110, 100, 97, 9, 0, 0, 0, 67, 105, 118, 105, 99, 32, 86, 84, 105, 6, 0, 0, 0, 97, 98, 99, 100, 101, 102}
115+
// See ~gocode/src/example-schema/CarExample.go for how this is generated
116+
data := []byte{45, 0, 1, 0, 1, 0, 0, 0, 210, 4, 0, 0, 0, 0, 0, 0, 221, 7, 1, 65, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 97, 98, 99, 100, 101, 102, 6, 208, 7, 4, 49, 50, 51, 35, 1, 78, 200, 6, 0, 3, 0, 30, 0, 154, 153, 15, 66, 11, 0, 0, 0, 85, 114, 98, 97, 110, 32, 67, 121, 99, 108, 101, 55, 0, 0, 0, 68, 66, 14, 0, 0, 0, 67, 111, 109, 98, 105, 110, 101, 100, 32, 67, 121, 99, 108, 101, 75, 0, 0, 0, 32, 66, 13, 0, 0, 0, 72, 105, 103, 104, 119, 97, 121, 32, 67, 121, 99, 108, 101, 1, 0, 2, 0, 95, 6, 0, 3, 0, 30, 0, 0, 0, 128, 64, 60, 0, 0, 0, 240, 64, 100, 0, 51, 51, 67, 65, 99, 6, 0, 3, 0, 30, 0, 51, 51, 115, 64, 60, 0, 51, 51, 227, 64, 100, 0, 205, 204, 60, 65, 5, 0, 0, 0, 72, 111, 110, 100, 97, 9, 0, 0, 0, 67, 105, 118, 105, 99, 32, 86, 84, 105, 6, 0, 0, 0, 97, 98, 99, 100, 101, 102}
119117

120118
buf := bytes.NewBuffer(data)
121119
m := NewSbeGoMarshaller()

0 commit comments

Comments
 (0)