Skip to content
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

Tests for pyctr.type.config #28

Open
20 tasks
ihaveamac opened this issue Jun 25, 2023 · 0 comments
Open
20 tasks

Tests for pyctr.type.config #28

ihaveamac opened this issue Jun 25, 2023 · 0 comments
Labels
tests relating to testing pyctr

Comments

@ihaveamac
Copy link
Owner

Things to check:

  • save
    • valid save loads
      • known blocks are loaded with correct data and flags
      • to_bytes results in the same file
    • valid use
      • get block with size <= 4 (data is in block entries, replacing size field)
      • get block with size > 4 (data is in data section)
      • setting and adding blocks works and to_bytes results in expected file
      • setting with flags 8, 10, 12, and 14 works
      • default flag is 14 (0xE) and is returned when getting block
    • invalid save
      • invalid entry count - InvalidConfigSaveError
      • invalid data offset (past file and before entries) - InvalidConfigSaveError
      • config entries in wrong order (blocks in the data section should be in reverse order to entries)
    • invalid use
      • get block that doesn't exist - BlockIDNotFoundError
      • remove block that doesn't exist - BlockIDNotFoundError
      • flag that isn't 8, 10, 12, or 14 - BlockFlagsNotAllowed
      • data that is too big (file can only be 0x8000 total) - OutOfSpaceConfigSaveError
  • blocks (as it currently stands)
    • valid uses
      • get_username (must return string)
      • get_user_time_offset (must return int)
      • get_system_model (must return SystemModel)
    • invalid uses
      • get_username (invalid utf-16le?)
      • get_user_time_offset (???)
      • get_system_model (a value not in SystemModel)
@ihaveamac ihaveamac added the tests relating to testing pyctr label Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests relating to testing pyctr
Projects
None yet
Development

No branches or pull requests

1 participant