Skip to content

Commit aa910de

Browse files
committed
Corrected writer log
1 parent 34dcdea commit aa910de

File tree

4 files changed

+8
-20
lines changed

4 files changed

+8
-20
lines changed

.github/workflows/test.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Test and coverage
22
on:
33
push:
4-
branches: [main]
4+
branches: [*]
55
pull_request:
66
branches: [main]
77
jobs:
@@ -17,14 +17,5 @@ jobs:
1717
uses: actions/setup-go@v2
1818
with:
1919
go-version: '1.19.0'
20-
- name: Check gofmt on libs
21-
run: |
22-
unformatted_files=$(gofmt -l libs)
23-
if [[ -n "$unformatted_files" ]]; then
24-
echo "The following files are not properly formatted:"
25-
echo "$unformatted_files"
26-
echo "Run 'gofmt -w libs' to fix formatting."
27-
exit 1
28-
fi
2920
- name: Run coverage
3021
run: go test ./... -race -coverpkg=./libs/... -coverprofile=coverage.out -covermode=atomic

lump/primitive/common/common.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,4 @@ type MapDispInfo struct {
107107
}
108108

109109
// CompressedLightCube
110-
type CompressedLightCube struct {
111-
// Color
112-
Color [6]ColorRGBExponent32 `json:"color"`
113-
}
110+
type CompressedLightCube = [6]ColorRGBExponent32

lump/primitive/leafambientlighting/leafambientlighting.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ type LeafAmbientLighting struct {
1515
// Z z
1616
Z byte `json:"z"`
1717
// Pad is padding to 4 bytes (any other purpose unknown).
18-
Unknown1 byte
18+
Pad byte
1919
}

writer_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ func TestWriter_Write(t *testing.T) {
8888

8989
expectedLumpOffset := int(binary.LittleEndian.Uint32(expectedBytes[offset : offset+4]))
9090
expectedLumpLength := int(binary.LittleEndian.Uint32(expectedBytes[offset+4 : offset+8]))
91-
actualLumpOffset := int(binary.LittleEndian.Uint32(expectedBytes[offset : offset+4]))
92-
actualLumpLength := int(binary.LittleEndian.Uint32(expectedBytes[offset+4 : offset+8]))
91+
actualLumpOffset := int(binary.LittleEndian.Uint32(actual[offset : offset+4]))
92+
actualLumpLength := int(binary.LittleEndian.Uint32(actual[offset+4 : offset+8]))
9393

9494
log.Printf("%d: offset: %d, %d (%d). length: %d, %d (%d). Version: %d, %d\n", i,
9595
expectedLumpOffset,
@@ -126,9 +126,9 @@ func TestWriter_Write(t *testing.T) {
126126
t.Errorf("toBytes(%s) returned unexpected bytes", tc.filePath)
127127
}
128128

129-
//if diff := cmp.Diff(expectedBytes, actual); diff != "" {
130-
// t.Errorf("toBytes(%s) returned unexpected diff (-want +got):\n%s", tc.filePath, diff)
131-
//}
129+
if diff := cmp.Diff(expectedBytes, actual); diff != "" {
130+
t.Errorf("toBytes(%s) returned unexpected diff (-want +got):\n%s", tc.filePath, diff)
131+
}
132132
}
133133
})
134134
}

0 commit comments

Comments
 (0)