yaml-cpp/test
Ted Lyngmo 5fe775248a Make Node move constructor and assignment operator noexcept (#809)
Move constructor:
 * m_isValid    (bool)                 exchange(rhs.m_isValid, true)
 * m_invalidKey (std::string)          std::move()
 * m_pMemory    (shared_memory_holder) std::move()
 * m_pNode      (node*)                exchange(rhs.m_pNode, nullptr)

 This leaves the moved-from Node as if it was just default constructed.

Move assignment:
 A sanity test is performed to check if it's a valid move, and
 if not: *this is returned (with an added assert() for debugging).

 A temporary Node is move constructed (using the move constructor), leaving
 the moved-from Node as if it was just default constructed.

 If this->m_pNode == nullptr, the same operation as AssignNode would do is done
 and *this is returned.

 if temporary.m_pNode == nullptr:
  m_pNode->set_null()
  swap(*this, temporary)
  return *this;

 Otherwise the merge step that AssignNode would do if both m_pNodes are not
 nullptr is done, using a new member function, AssignNodeDetail().

Signed-off-by: Ted Lyngmo <ted@lyncon.se>
2020-02-15 13:29:00 +01:00
..
gtest-1.8.0 test: Upgrade googlemock 1.7.0 to googletest 1.8.0 2017-08-24 22:49:17 -05:00
integration Add IsNull() check in test after reassignment (#814) 2020-02-07 10:52:43 -06:00
node Make Node move constructor and assignment operator noexcept (#809) 2020-02-15 13:29:00 +01:00
BUILD.bazel Add bazel Support (#724) 2019-09-27 10:11:38 -05:00
CMakeLists.txt Fix CMake 3.10 and below compatibility (#763) 2019-10-04 14:46:18 -05:00
create-emitter-tests.py Add optional OnAnchor method to EventHandler (#530) 2019-03-12 15:24:32 -07:00
handler_test.h Factored out HandlerTest as a base class 2014-03-23 16:26:44 -05:00
main.cpp Convert node tests to gtest 2014-03-23 19:21:13 -05:00
mock_event_handler.h Small readability improvements in Parser 2019-11-23 13:17:02 -06:00
ostream_wrapper_test.cpp Refactor CMake to use more modern paradigms (#741) 2019-09-27 09:59:53 -05:00
parser_test.cpp Small readability improvements in Parser 2019-11-23 13:17:02 -06:00
regex_test.cpp Apply formatting/style tweaks to comply with compile time diagnostics for g++ and clang++ (#686) 2019-03-13 15:18:34 -07:00
specexamples.h Convert spec tests to gtest with gmock 2014-03-23 12:49:30 -05:00