Skip to content

32-bit test failures in libgv/utf16chunk/chunkreader_test.go #2

@fossdd

Description

@fossdd

go test fails on common 32-bit architectures like armhf, armv7, x86.

# go.mau.fi/mautrix-gvoice/pkg/libgv/utf16chunk_test [go.mau.fi/mautrix-gvoice/pkg/libgv/utf16chunk.test]
pkg/libgv/utf16chunk/chunkreader_test.go:111:51: cannot use 1 << 31 (untyped int constant 2147483648) as int value in argument to utf16chunk.UTF16Length (overflows)

The related line:

got, _ := utf16chunk.UTF16Length([]byte(input), 1<<31)

I guess that's not a a high priority but nice to fix. Thanks for all the mautrix-* stuff, really makes me happy!

BTW, to setup a armv7 build environment you could use docker if you don't have real hardware handy:

$ doas docker run --platform linux/arm/v7 -it -v .:/gvoice arm32v7/alpine
# apk add go
# cd gvoice
# go test -v ./pkg/libgv/utf16chunk/

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions