pyctr icon indicating copy to clipboard operation
pyctr copied to clipboard

Tests for pyctr.type.config

Open ihaveamac opened this issue 1 year ago • 0 comments

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 avatar Jun 25 '23 00:06 ihaveamac