Skip to content

Fix error handling for invalid scenario names and numbers #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

None yet

1 participant