Skip to content

Commit 6b5bc9c

Browse files
authored
Merge pull request #533 from billsegall/issue532
Issue #532 `make test` in gocode directory fails
2 parents 43b94e1 + 4fc3dae commit 6b5bc9c

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

gocode/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ all: example test # bench
1717
# use this one output file to check that dependency as it's simple
1818
DEP=src/simple/SbeMarshalling.go
1919
$(DEP): $(SBE_JAR)
20-
(cd ..; gradlew generateGolangCodecs)
20+
(cd ..; ./gradlew generateGolangCodecs)
2121
(export GOPATH=$(GOPATH) && \
2222
cd src/simple && \
2323
go build && \

gocode/src/issue483/Issue483_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ func TestPresence(t *testing.T) {
2222
t.Fail()
2323
}
2424

25+
// Check contant value is set by init func
26+
Issue483Init(issue483)
27+
if issue483.Constant != 1 {
28+
t.Log("Constant's value should be 1")
29+
t.Fail()
30+
}
31+
2532
if issue483.OptionalMetaAttribute(4) != "optional" {
2633
t.Log("Optional attribute's presence should be 'optional'")
2734
t.Fail()

sbe-tool/src/test/resources/issue483.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
<type name="schemaId" primitiveType="uint16"/>
1414
<type name="version" primitiveType="uint16"/>
1515
</composite>
16+
<enum name="constval" encodingType="uint8">
17+
<validValue name="one">1</validValue>
18+
</enum>
1619
</types>
1720
<sbe:message name="issue483" id="1" description="issue 483 test">
18-
<field name="unset" type="uint64" id="2"/>
19-
<field name="required" type="uint64" id="3" presence="required"/>
20-
<field name="constant" type="uint64" id="4" presence="constant"/>
21-
<field name="optional" type="uint64" id="5" presence="optional"/>
21+
<field name="unset" type="uint8" id="2"/>
22+
<field name="required" type="uint8" id="3" presence="required"/>
23+
<field name="constant" type="uint8" id="4" presence="constant" valueRef="constval.one"/>
24+
<field name="optional" type="uint8" id="5" presence="optional"/>
2225
</sbe:message>
2326
</sbe:messageSchema>

0 commit comments

Comments
 (0)