[haiku-bugs] Re: [Haiku] #12799: Unit test BClipboard::Clear1 crashes

  • From: "pulkomandy" <trac@xxxxxxxxxxxx>
  • Date: Thu, 26 May 2016 08:57:45 -0000

#12799: Unit test BClipboard::Clear1 crashes
----------------------------+----------------------------
   Reporter:  markh         |      Owner:  bonefish
       Type:  bug           |     Status:  new
   Priority:  normal        |  Milestone:  Unscheduled
  Component:  Build System  |    Version:  R1/Development
 Resolution:                |   Keywords:
 Blocked By:                |   Blocking:
Has a Patch:  0             |   Platform:  All
----------------------------+----------------------------

Comment (by pulkomandy):

 The docs at api.haiku-os.org are "reverse engineered" from the code. They
 reflect the current behavior, not always the expected one.

 An analysis of the commit log for BClipboard sheds some light (maybe):
 * In http://cgit.haiku-
 
os.org/haiku/commit/src/kits/app/Clipboard.cpp?id=b010ca67201c6b96d2136d4feca376bb9afe9a57
 , the code for Clear() calls AssertLocked which at the time was the same
 as IsLocked(),
 * In http://cgit.haiku-
 
os.org/haiku/commit/src/kits/app/Clipboard.cpp?id=76441bab6ebb9132d0bb0ab623087bd2b9e861e0
 , AssertLocked() was changed to call debugger(), but Clear() was not
 adjusted to call IsLocked() instead.

 The fix is simply adjusting Clear() to use IsLocked(), and adjusting the
 docs (they are also in the source tree in docs/user/) to match the correct
 (BeOS-compatible) behavior.

--
Ticket URL: <https://dev.haiku-os.org/ticket/12799#comment:2>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: