Add C++ wrapper coverage tests (82% -> 90%)#307
Merged
toruseo merged 3 commits intotoruseo:mainfrom Apr 3, 2026
Merged
Conversation
New tests covering vehicle abort/logs, route manipulation, mid-simulation link queries, link setters, World utility methods, node signals, Route dunders, taxi NotImplementedError, demand methods, and link auto-rename. Wrapper coverage: 82% -> 90% (73 additional lines covered). All 182 tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New tests directly calling C++ bindings for vehicle log methods, batch log APIs, world query methods, and edge cases (signals, capacity constraints, specified_route, generation_queue). C++ coverage: 74% -> 92% (traffi.cpp: 93%, bindings.cpp: 91%) Wrapper coverage: 90% All 186 tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace 4 tests that accessed _cpp_world/_cpp_vehicle internals with 3 tests using only the public API (W.xxx, veh.xxx, link.xxx). Coverage results (public API only): - Python wrapper: 90% - C++ engine: 74% (unreachable dead code accounts for the gap to 90%) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/test_cpp_mode.pycovering previously untested C++ wrapper code pathsNew tests
test_coverage_vehicle_abort_and_all_logstraveled_route(),AttributeErrortest_coverage_vehicle_route_manipulationenforce_route,set_links_prefer,set_links_avoidtest_coverage_link_mid_simulation_queriesspeed/density/flow,arrival_count/departure_count,instant_travel_time/actual_travel_timewith boundary valuestest_coverage_link_setters_and_eular_dxcapacity_in_remain/capacity_out_remainsetters, mid-sim cumulative curve access,edie_dxtest_coverage_misc_world_methodsget_node/get_linkedge cases,NotImplementedErrorstubs,on_time,change_print_modetest_coverage_node_signal_and_renamereprtest_coverage_route_dunder_methods__repr__/__iter__/__len__/__getitem__on Routetest_coverage_addVehicle_taxi_and_links_avoidNotImplementedError,links_avoidparametertest_coverage_demand_methodsadddemand_point2point,adddemand_area2area,adddemand_area2area2,adddemand_nodes2nodes2test_coverage_link_auto_renameauto_rename=True/FalseAll tests use real simulations (no mocks) with small networks.
Test plan
--reruns 5)coverage.py)Part of #297
🤖 Generated with Claude Code