Changeset 645:7f8f1f16dfe1


Ignore:
Timestamp:
05/14/08 15:47:43 (2 years ago)
Author:
Howard Butler <hobu.inc@…>
Branch:
default
Convert:
svn:1766ff46-f334-0410-ab20-d63176f87757/trunk@712
Message:

fix up LASVLR stuff so read tests pass

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • include/liblas/lasrecordheader.hpp

    r644 r645  
    8282    /// The character data is up to 16 bytes long. 
    8383    /// \exception No throw 
    84     std::string GetUserId(bool pad /*= false*/); 
     84    std::string GetUserId(bool pad /*= false*/) const; 
    8585     
    8686    void SetUserId(std::string const&); 
     
    102102    /// The character data is up to 32 bytes long. 
    103103    /// \exception No throw 
    104     std::string GetDescription(bool pad /*= false*/); 
     104    std::string GetDescription(bool pad /*= false*/) const; 
    105105     
    106106    void SetDescription(std::string const&); 
  • src/lasrecordheader.cpp

    r644 r645  
    116116} 
    117117 
    118 std::string LASVLR::GetUserId(bool pad /*= false*/) 
     118std::string LASVLR::GetUserId(bool pad /*= false*/) const 
    119119{ 
    120120    // copy array of chars and trim zeros if smaller than 32 bytes 
     
    161161} 
    162162 
    163 std::string LASVLR::GetDescription(bool pad /*= false*/) 
     163std::string LASVLR::GetDescription(bool pad /*= false*/) const 
    164164{ 
    165165    // copy array of chars and trim zeros if smaller than 32 bytes 
     
    201201{ 
    202202    return (m_recordId == other.m_recordId 
    203             && m_userId == other.m_userId  
    204             && m_desc == other.m_desc 
     203            && std::string(m_userId) == std::string(other.m_userId)  
     204            && std::string(m_desc) == std::string(other.m_desc) 
    205205            && m_reserved == other.m_reserved 
    206206            && m_recordLength == other.m_recordLength); 
  • test/unit/lasrecordheader_test.cpp

    r460 r645  
    1515    struct lasrecordheader_data 
    1616    { 
    17         liblas::LASRecordHeader m_default; 
     17        liblas::LASVLR m_default; 
    1818 
    19         void test_default(liblas::LASRecordHeader const& h) 
     19        void test_default(liblas::LASVLR const& h) 
    2020        { 
    2121            ensure_equals("wrong default reserved bytes", 
     
    2626 
    2727            ensure_equals("wrong default record length", 
    28                 h.GeRecordLength(), liblas::uint16_t()); 
     28                h.GetRecordLength(), liblas::uint16_t()); 
    2929 
    3030            ensure_equals("wrong default user identifier", 
    31                 h.GetUserId(), std::string()); 
     31                h.GetUserId(true).c_str(), std::string()); 
    3232 
    3333            ensure_equals("wrong default description", 
    34                 h.GetUserId(), std::string()); 
     34                h.GetDescription(true).c_str(), std::string()); 
    3535        } 
    3636    }; 
     
    3939    typedef tg::object to; 
    4040 
    41     tg test_group_lasrecordheader("liblas::LASRecordHeader"); 
     41    tg test_group_lasrecordheader("liblas::LASVLR"); 
    4242 
    4343    // Test default constructor 
     
    5454    void to::test<2>() 
    5555    { 
    56         liblas::LASRecordHeader hdr_copy(m_default); 
     56        liblas::LASVLR hdr_copy(m_default); 
    5757        test_default(hdr_copy); 
    5858    } 
     
    6363    void to::test<3>() 
    6464    { 
    65         liblas::LASRecordHeader hdr_copy; 
     65        liblas::LASVLR hdr_copy; 
    6666        test_default(hdr_copy); 
    6767 
     
    7575    void to::test<4>() 
    7676    { 
    77         liblas::LASRecordHeader hdr; 
     77        liblas::LASVLR hdr; 
    7878        ensure("two default headers not equal", m_default.equal(hdr)); 
    7979 
    80         liblas::LASRecordHeader hdr_copy(m_default); 
     80        liblas::LASVLR hdr_copy(m_default); 
    8181        ensure("copy of default header not equal", hdr.equal(m_default)); 
    8282    } 
     
    8787    void to::test<5>() 
    8888    { 
    89         liblas::LASRecordHeader hdr; 
     89        liblas::LASVLR hdr; 
    9090        ensure("two default headers not equal", m_default == hdr); 
    9191 
    92         liblas::LASRecordHeader hdr_copy(m_default); 
     92        liblas::LASVLR hdr_copy(m_default); 
    9393        ensure("copy of default header not equal", hdr == m_default); 
    9494    } 
     
    9999    void to::test<6>() 
    100100    { 
    101         liblas::LASRecordHeader hdr; 
     101        liblas::LASVLR hdr; 
    102102        ensure_not("two default headers not equal", m_default != hdr); 
    103103 
    104         liblas::LASRecordHeader hdr_copy(m_default); 
     104        liblas::LASVLR hdr_copy(m_default); 
    105105        ensure_not("copy of default header not equal", hdr != m_default); 
    106106    } 
Note: See TracChangeset for help on using the changeset viewer.