mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
Group lookups (createNodeIfNeeded, findCardNode) must not resolve a mirrored custom zone that shares the group name. Introduce findGroupChild to search only non-custom children, and make addCard consult the deck tree before falling back to creating a top-level zone so cards added to an un-mirrored custom zone land inside it. mirrorCustomZones now flattens cards nested at any depth into the mirrored zone so no card is left without a model row. Add model behaviour tests (addCard routing, same-name group/zone collision, removeRows guard, empty-zone survival, findCard inside a custom zone) and fix the missing main() in the unit test binaries.
33 lines
1,001 B
CMake
33 lines
1,001 B
CMake
add_executable(deck_list_model_custom_zones_test ${VERSION_STRING_CPP} deck_list_model_custom_zones_test.cpp)
|
|
|
|
if(NOT GTEST_FOUND)
|
|
add_dependencies(deck_list_model_custom_zones_test gtest)
|
|
endif()
|
|
|
|
target_link_libraries(
|
|
deck_list_model_custom_zones_test
|
|
libcockatrice_models
|
|
libcockatrice_card
|
|
libcockatrice_deck_list
|
|
Threads::Threads
|
|
${GTEST_BOTH_LIBRARIES}
|
|
${TEST_QT_MODULES}
|
|
)
|
|
add_test(NAME deck_list_model_custom_zones_test COMMAND deck_list_model_custom_zones_test)
|
|
|
|
add_executable(deck_list_model_zone_integration_test ${VERSION_STRING_CPP} deck_list_model_zone_integration_test.cpp)
|
|
|
|
if(NOT GTEST_FOUND)
|
|
add_dependencies(deck_list_model_zone_integration_test gtest)
|
|
endif()
|
|
|
|
target_link_libraries(
|
|
deck_list_model_zone_integration_test
|
|
libcockatrice_models
|
|
libcockatrice_card
|
|
libcockatrice_deck_list
|
|
Threads::Threads
|
|
${GTEST_BOTH_LIBRARIES}
|
|
${TEST_QT_MODULES}
|
|
)
|
|
add_test(NAME deck_list_model_zone_integration_test COMMAND deck_list_model_zone_integration_test)
|