Skip to content

Overflow test failed #21

@db4

Description

@db4
# Error: Test ppx_protobuf:0:Test wire format:2:test_overflow (in the log).
#
# File "src_test/test_wire.ml", line 92, characters 1-1:
# Error: Test ppx_protobuf:0:Test wire format:2:test_overflow (in the code).
#
# expected exception Protobuf.Decoder.Failure(Overflow("")), but no exception was raised.
# ------------------------------------------------------------------------------
# Ran: 31 tests in: 0.16 seconds.
# FAILED: Cases: 31 Tried: 31 Errors: 1 Failures: 1 Skip:  0 Todo: 0 Timeouts: 0.

Why

let test_overflow ctxt =
  if Sys.word_size = 32 then
    assert_raises Decoder.(Failure (Overflow ""))
                  (fun () -> Decoder.int_of_int32 "" 0xffffffffl)
  else

should overflow? 0xffffffffl = -1 on 32 bit systems - perfectly fits to int

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions