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

unit tests for src/common/buffer.{cc,h} #41

Closed
wants to merge 2 commits into from
Closed

unit tests for src/common/buffer.{cc,h} #41

wants to merge 2 commits into from

Commits on Feb 11, 2013

  1. unit tests for src/common/buffer.{cc,h} constructors

    The following static constructors are implemented by opaque classes
    defined in buffer.cc ( buffer::raw_char, buffer::raw_posix_aligned
    etc. ). Testing the implementation of these classes is done by
    variations of the calls to the static constructors.
    
    copy(const char *c, unsigned len);
    create(unsigned len);
    claim_char(unsigned len, char *buf);
    create_malloc(unsigned len);
    claim_malloc(unsigned len, char *buf);
    create_static(unsigned len, char *buf);
    create_page_aligned(unsigned len);
    
    The raw_mmap_pages class cannot be tested because it is commented out in
    raw_posix_aligned. The raw_hack_aligned class is only tested under Cygwin.
    The raw_posix_aligned class is not tested under Cygwin.
    
    The unittest_bufferlist.sh script calls unittest_bufferlist with the
    CEPH_BUFFER_TRACK=true environment variable to enable the code
    tracking the memory usage. It cannot be done within the bufferlist.cc
    file itself because it relies on the initialization of a global
    variable  ( buffer_track_alloc ).
    
    When raw_posix_aligned is called on DARWIN, the data is not aligned
    on CEPH_PAGE_SIZE because it calls valloc(size) which is the equivalent of
    memalign(sysconf(_SC_PAGESIZE),size) and not memalign(CEPH_PAGE_SIZE,size).
    For this reason the alignment test is de-activated on DARWIN.
    
    tracker.ceph.com/issues/4066 refs #4066
    
    Signed-off-by: Loic Dachary <loic@dachary.org>
    Loic Dachary committed Feb 11, 2013
    Configuration menu
    Copy the full SHA
    53ff08f View commit details
    Browse the repository at this point in the history
  2. Most buffer::ptr methods, proper comment TBD

    Loic Dachary committed Feb 11, 2013
    Configuration menu
    Copy the full SHA
    2019d41 View commit details
    Browse the repository at this point in the history