Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure on 32bit architectures #202

Closed
gibmat opened this issue Jun 16, 2023 · 1 comment · Fixed by #204
Closed

Test failure on 32bit architectures #202

gibmat opened this issue Jun 16, 2023 · 1 comment · Fixed by #204
Assignees
Labels
bug Something isn't working
Milestone

Comments

@gibmat
Copy link

gibmat commented Jun 16, 2023

Describe the bug

Attempting to run the tests on any 32bit architecture results in the following error:

# github.com/rabbitmq/amqp091-go_test [github.com/rabbitmq/amqp091-go.test]
src/github.com/rabbitmq/amqp091-go/examples_test.go:535:39: cannot use 5_000_000_000 (untyped int constant 5000000000) as int value in map literal (overflows)
FAIL	github.com/rabbitmq/amqp091-go [build failed]
FAIL

Explicitly defining that constant as an int64 fixes the issue:

diff --git a/examples_test.go b/examples_test.go
index d83a824..98872ed 100644
--- a/examples_test.go
+++ b/examples_test.go
@@ -532,7 +532,7 @@ func ExampleChannel_QueueDeclare_stream() {
 		false,             // noWait
 		amqp.Table{ // queue args
 			amqp.QueueTypeArg:                 amqp.QueueTypeStream,
-			amqp.StreamMaxLenBytesArg:         5_000_000_000, // 5 Gb
+			amqp.StreamMaxLenBytesArg:         int64(5_000_000_000), // 5 Gb
 			amqp.StreamMaxSegmentSizeBytesArg: 500_000_000,   // 500 Mb
 			amqp.StreamMaxAgeArg:              "3D",          // 3 days
 		},

(Seen while updating the Debian packaging for this library.)

Reproduction steps

Run the tests on an i386, armel, or armhf system.

Expected behavior

Everything works on both 32 and 64 bit systems. :)

Additional context

No response

@gibmat gibmat added the bug Something isn't working label Jun 16, 2023
@Zerpet Zerpet added this to the 1.9.0 milestone Jun 20, 2023
@Zerpet Zerpet self-assigned this Jun 20, 2023
@Zerpet
Copy link
Contributor

Zerpet commented Jun 20, 2023

Thanks for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants