Skip to content

Conversation

davidlin2k
Copy link

@davidlin2k davidlin2k commented Mar 21, 2025

This pull request includes changes to improve error handling and validation for scenario names and numbers in the src/aqm-eval-suite/examples/aqm-eval-suite-runner.cc file. The most important changes include adding checks for invalid scenario numbers, providing user feedback for invalid inputs, and ensuring that scenario names are validated before execution.

Error handling improvements:

  • Added a check to validate scenarioNumber and provide an error message if it is invalid, including a list of valid scenario numbers.
  • Implemented a validation check for scenarioName to ensure it is either "All", "RttFairness", or a valid scenario name from the ScenarioNumberMapping. If invalid, an error message is displayed with a list of valid scenario names.

Code simplification:

  • Replaced the iterator-based loop with a range-based for loop for better readability and modern C++ practices.

Example:

$ ./waf --run "aqm-eval-suite-runner --number=123"
Error: Invalid scenario number "123"
Valid scenario numbers are: "5.1.1" "5.1.2" "5.2" "5.3.1" "5.3.2" "5.4" "6" "8.2.2" "8.2.3" "8.2.4" "8.2.5" "8.2.6.1" "8.2.6.2"
Command ['/home/csc309/projects/ns-3-aqm-eval-suite/ns-3-dev-git/build/src/aqm-eval-suite/examples/ns3-dev-aqm-eval-suite-runner-debug', '--number=123'] exited with code 255

…r valid scenario numbers and names, providing error messages for invalid inputs. Improved scenario execution logic for clarity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant