From 3bc4be2d307cbdad50e0796ffd133400487d2d68 Mon Sep 17 00:00:00 2001 From: Galaco Date: Mon, 10 May 2021 19:21:08 +0900 Subject: [PATCH] Fixed broken tests --- .travis.yml | 30 --------------------------- README.md | 7 ++++--- go.mod | 2 +- go.sum | 7 ++----- lump_test.go | 2 +- primitives/game/staticpropv10_test.go | 9 ++++++-- 6 files changed, 15 insertions(+), 42 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a5c7952..0000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -sudo: false - -language: go - -env: - - GO111MODULE=on - -go: - - 1.12.x - - tip - -git: - depth: 1 - -install: true - -notifications: - email: false - -before_script: - - go get -v github.com/golangci/golangci-lint/cmd/golangci-lint - -script: - - golangci-lint run - - go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... - - - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/README.md b/README.md index 92d24bf..9c945e8 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ Go library for handling Source Engine .bsp map files. ### Features: -* Read support for (most) non-xbox360 bsps (v20,21). v19 support limited, may work +* Read support for (most) non-xbox360 BSPs (v20,21). v19 support limited, may work * Freely modify and resize any Lump data * Limited write support, mostly untested -##### Not all lumps are current supported, but can be freely read and modified, as they are treated as `[]byte` +##### Not all lumps are currently supported, but can be freely read and modified, as they are treated as `[]byte` -The following lumps currently have a full implementation for v20 & v21 bsp's (tested against CS:S & CS:GO): +The following lumps currently have a full implementation for v20 & v21 BSPs (tested against CS:S & CS:GO): ``` 0: Entdata @@ -63,6 +63,7 @@ The following lumps currently have a full implementation for v20 & v21 bsp's (te 48: DispTris 51: LeafAmbientIndexHDR 52: LeafAmbientIndex +53: WorldLightHDR 54: WorldLightHDR 55: LeafAmbientLightingHDR 56: LeafAmbientLighting diff --git a/go.mod b/go.mod index 2dd036a..5ea5963 100644 --- a/go.mod +++ b/go.mod @@ -4,5 +4,5 @@ go 1.12 require ( github.com/go-gl/mathgl v1.0.0 - golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect + golang.org/x/image v0.0.0-20210504121937-7319ad40d33e // indirect ) diff --git a/go.sum b/go.sum index 8232fc5..0e818aa 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,8 @@ -github.com/go-gl/mathgl v0.0.0-20190713194549-592312d8590a h1:yoAEv7yeWqfL/l9A/J5QOndXIJCldv+uuQB1DSNQbS0= -github.com/go-gl/mathgl v0.0.0-20190713194549-592312d8590a/go.mod h1:yhpkQzEiH9yPyxDUGzkmgScbaBVlhC06qodikEM0ZwQ= github.com/go-gl/mathgl v1.0.0 h1:t9DznWJlXxxjeeKLIdovCOVJQk/GzDEL7h/h+Ro2B68= github.com/go-gl/mathgl v1.0.0/go.mod h1:yhpkQzEiH9yPyxDUGzkmgScbaBVlhC06qodikEM0ZwQ= -golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f h1:FO4MZ3N56GnxbqxGKqh+YTzUWQ2sDwtFQEZgLOxh9Jc= golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a h1:gHevYm0pO4QUbwy8Dmdr01R5r1BuKtfYqRqF0h/Cbh0= -golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk= golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210504121937-7319ad40d33e h1:PzJMNfFQx+QO9hrC1GwZ4BoPGeNGhfeQEgcQFArEjPk= +golang.org/x/image v0.0.0-20210504121937-7319ad40d33e/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/lump_test.go b/lump_test.go index acbe1cc..9511b8a 100644 --- a/lump_test.go +++ b/lump_test.go @@ -132,7 +132,7 @@ func getExpectedLump(index int) lumps.ILump { &lumps.Unimplemented{}, &lumps.LeafAmbientIndexHDR{}, &lumps.LeafAmbientIndex{}, - &lumps.Unimplemented{}, + &lumps.Lighting{}, &lumps.WorldLightHDR{}, &lumps.LeafAmbientLightingHDR{}, &lumps.LeafAmbientLighting{}, diff --git a/primitives/game/staticpropv10_test.go b/primitives/game/staticpropv10_test.go index c0eb0ed..ab699a3 100644 --- a/primitives/game/staticpropv10_test.go +++ b/primitives/game/staticpropv10_test.go @@ -24,7 +24,7 @@ func TestStaticPropV10_GetDiffuseModulation(t *testing.T) { func TestStaticPropV10_GetDisableXBox360(t *testing.T) { sut := getStaticPropV10() - if sut.GetDisableXBox360() != true { + if sut.GetDisableXBox360() != false { t.Error("unexpected value for unknown property") } @@ -174,7 +174,13 @@ func TestStaticPropV10_GetUniformScale(t *testing.T) { if sut.GetUniformScale() != 1 { t.Error("unexpected value for uniformScale property") } +} +func TestStaticPropV10_GetExtraFlags(t *testing.T) { + sut := getStaticPropV10() + if sut.GetExtraFlags() != 0 { + t.Error("unexpected value for extra flags property") + } } func TestStaticPropV10_GetUnknown(t *testing.T) { @@ -182,7 +188,6 @@ func TestStaticPropV10_GetUnknown(t *testing.T) { if sut.GetUnknown() != 0 { t.Error("unexpected value for unknown property") } - } func getStaticPropV10() *StaticPropV10 {