[haiku-commits] Change in haiku[master]: tests/kits/support/bmemoryio: Fix WriteTest

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 1 Jan 2020 09:28:42 +0000

From Kyle Ambroff-Kao <kyle@xxxxxxxxxxxxxx>:

Kyle Ambroff-Kao has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/2066 ;)


Change subject: tests/kits/support/bmemoryio: Fix WriteTest
......................................................................

tests/kits/support/bmemoryio: Fix WriteTest

This patch fixes a bug in the BMemoryIO unit tests that made them
fail and adds an additional test case for read-only buffers.

The failing test case invokes BMemoryIO::WriteAt() with the position
parameter set to -10, which is invalid and should result in a return
value of B_BAD_VALUE. And it does, but the test fails because it was
testing for the return value 5, as in 5 bytes copied.

An additional test case is added for read-only BMemoryIO objects. If
the BMemoryIO(const void*, size_t) constructor is used then it will be
marked as read-only, so writes should fail with B_NOT_ALLOWED.
---
M src/tests/kits/support/bmemoryio/WriteTest.cpp
1 file changed, 10 insertions(+), 1 deletion(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/66/2066/1
--
To view, visit https://review.haiku-os.org/c/haiku/+/2066
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: Icf4b837c77fba2be958f9d3e4b3adb18a23b037f
Gerrit-Change-Number: 2066
Gerrit-PatchSet: 1
Gerrit-Owner: Kyle Ambroff-Kao <kyle@xxxxxxxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: tests/kits/support/bmemoryio: Fix WriteTest - Gerrit