apolukhin / Boost.DLL

Library for comfortable work with DLL and DSO
https://boost.org/libs/dll
109 stars 69 forks source link

Allow to query non-existant sections #32

Closed an-ky closed 8 years ago

an-ky commented 8 years ago

Sometimes it is convenient to query a library for a specific section and expect an empty result if the section does not exists. This was not possible because library_info ASSERTed the section adresses thus crashing the Application if a section was not found. Fixed this by checking section begin and end and returning an emtpy vector of string if the section was not found.

It seems only affect pe_info.hpp, the other implementations seem to allow empty sections (or handle them differently altogether)

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 93.122% when pulling c412ace49d876392cf7c36167cc6b2b6504af5a3 on an-ky:develop into b09c0b856779c1e6dae74d2ef042fac3b6bfb51d on apolukhin:develop.

an-ky commented 8 years ago

Ohh my bad, first of all I overlooked that library_info.sections() can be used to check for existence of a specific section. Second I missed to add tests for the case. Do you think this is a valid change of the library_info? Then I will extent the tests, of course.

apolukhin commented 8 years ago

Seems to be a good addition. Please add tests and I'll merge your pull request.

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 93.122% when pulling 54bdb7cc745e1802c6b5ca1989e06edf35e4cda7 on an-ky:develop into b09c0b856779c1e6dae74d2ef042fac3b6bfb51d on apolukhin:develop.

an-ky commented 8 years ago

Is this test appropriate? Sorry for spamming here, I'm overwhelmed by the grade git hub is automated. Awesome on one hand, confusing if one is not used to it.

Regards

apolukhin commented 8 years ago

Thanks! Everything is good!