History log of /openbmc/phosphor-power/test/file_descriptor_tests.cpp (Results 1 – 2 of 2)
Revision Date Author Comments
# 81e554c8 31-May-2023 Patrick Williams <patrick@stwcx.xyz>

tests: adjust self-copy tests

There are a couple tests which attempt to copy an object onto itself via
a `std::move`. GCC 13 catches this as a "move onto self" and flags it
as an error. Rather tha

tests: adjust self-copy tests

There are a couple tests which attempt to copy an object onto itself via
a `std::move`. GCC 13 catches this as a "move onto self" and flags it
as an error. Rather than use the `std::move`, perform a static_cast
into an r-value reference so that the same copy-constructor is called
as if the std::move were successfully used.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I097889578492b1a3ab456e8cb21a668aa0855be4

show more ...


# 9462e066 15-Sep-2020 Shawn McCarney <shawnmm@us.ibm.com>

FileDescriptor: Add move and close methods

Made the following enhancements to the FileDescriptor class:
* Moved header file from file.hpp to file_descriptor.hpp to match naming
con

FileDescriptor: Add move and close methods

Made the following enhancements to the FileDescriptor class:
* Moved header file from file.hpp to file_descriptor.hpp to match naming
convention used in other files.
* Added move constructor and move assignment operator so FileDescriptor
objects can be put in containers like std::vector.
* Added close() method so users of class can optionally close the
descriptor explicitly and check the return code for errors. If not
explicitly closed, the descriptor will still be closed by the destructor
which ignores errors.
* Added automated tests
* Added doxygen comments

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I1e05bbb232443ed1a79728768aaaa1efac8707ec

show more ...