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

Add more unit tests #2

Open
herzbube opened this issue Sep 21, 2020 · 3 comments
Open

Add more unit tests #2

herzbube opened this issue Sep 21, 2020 · 3 comments
Assignees
Labels

Comments

@herzbube
Copy link
Owner

Notes about the current test coverage.

[DONE] = tests exist
[OK] = no tests exist, but there's an explanation why that's ok for the moment

- src
  - [DONE] document
    - [DONE] typedproperty
      - [OK] SgfcBoardSizeProperty.h
        >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.
      - [OK] SgfcGameTypeProperty.h
        >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.
    - [DONE] typedpropertyvalue
      - [DONE] go
        - [OK] SgfcGoMovePropertyValue.h
          >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.
        - [OK] SgfcGoPointPropertyValue.h
          >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.
        - [OK] SgfcGoStonePropertyValue.h
          >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.
      - [OK] SgfcColorPropertyValue.h
        >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.
      - [OK] SgfcDoublePropertyValue.h
        >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.
      - [OK] SgfcMovePropertyValue.h
        >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.
      - [OK] SgfcNumberPropertyValue.h
        >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.
      - [OK] SgfcPointPropertyValue.h
        >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.
      - [OK] SgfcRealPropertyValue.h
        >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.
      - [OK] SgfcSimpleTextPropertyValue.h
        >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.
      - [OK] SgfcStonePropertyValue.h
        >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.
      - [OK] SgfcTextPropertyValue.h
        >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.
      - [OK] SgfcUnknownPropertyValue.h
        >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.          
    - [OK] SgfcComposedPropertyValue.h
      >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.          
    - [DONE] SgfcDocument.h
    - [DONE] SgfcGame.h
    - [DONE] SgfcNode.h
    - [OK] SgfcProperty.h
      >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.          
    - [OK] SgfcPropertyMetaInfo.h
      >>> Hardly worth testing because it's used only internally and the logic consists of one giant switch-statement, or is based on the value type descriptors.
    - [OK] SgfcSinglePropertyValue.h
      >>> Logic already tested via SgfcPropertyDecoder. Might be worth adding tests later.          
    - [DONE] SgfcTreeBuilder.h
        
  - factory
  - [DONE] game
    - [DONE] go
      - [DONE] SgfcGoMove.h
      - [DONE] SgfcGoPoint.h
      - [DONE] SgfcGoStone.h
    - [OK] SgfcBoardSize.cpp
      >>> Relatively simple data container, with a bit of logic. Might be worth adding tests later.
  - interface
    - internal
    - public
  - parsing
    - [DONE] propertyvaluetypedescriptor
      - [OK] SgfcPropertyBasicValueTypeDescriptor.h
        >>> Relatively simple data container, with almost no logic. Hardly worth testing because it's used only internally and only with hardcoded data.
      - [OK] SgfcPropertyComposedValueTypeDescriptor.h
        >>> Relatively simple data container, with almost no logic. Hardly worth testing because it's used only internally and only with hardcoded data.
      - [OK] SgfcPropertyDualValueTypeDescriptor.h
        >>> Relatively simple data container, with almost no logic. Hardly worth testing because it's used only internally and only with hardcoded data.
      - [OK] SgfcPropertyElistValueTypeDescriptor.h
        >>> Relatively simple data container, with almost no logic. Hardly worth testing because it's used only internally and only with hardcoded data.
      - [OK] SgfcPropertyListValueTypeDescriptor.h
        >>> Relatively simple data container, with almost no logic. Hardly worth testing because it's used only internally and only with hardcoded data.
    - SgfcDocumentEncoder.h
      >>> This needs testing. It's not yet clear how exactly, though. Indentation makes things harder to test than necessary, also platform-specific line endings (std::endl) might become an issue.
    - [DONE] SgfcPropertyDecoder.h
    - [DONE] SgfcValueConverter.h
    
  - [DONE] sgfc
    - [DONE] backend
      - [DONE] SgfcBackendController.h
      - [OK] SgfcBackendDataState.h
        >>> only an enum type
      - [DONE] SgfcBackendDataWrapper.h
      - [OK] SgfcBackendLoadResult.h
        >>> Simple data container
      - [OK] SgfcBackendSaveResult.h
        >>> Simple data container
      - [OK] SgfcOptions.h
        >>> There's not much that can be tested here. The only imaginable test
            would be to check whether a capture/restore cycle restores the correct
            values.
    - [DONE] frontend
      - [DONE] SgfcCommandLine.h
      - [OK] SgfcDocumentReadResult.h
        >>> Relatively simple data container, with a bit of logic. Might be worth adding tests later.
      - [DONE] SgfcDocumentReader.h
      - [OK] SgfcDocumentWriteResult.h
        >>> Relatively simple data container, with a bit of logic. Might be worth adding tests later.
      - [DONE] SgfcDocumentWriter.h
    - [DONE] message
      - [DONE] SgfcMessage.h
      - [DONE] SgfcMessageParser.h
      - [DONE] SgfcMessageStream.h
    - [DONE] save
      - [DONE] SgfcSaveStream.h
      - [DONE] SgfcSgfContent.h
  - [OK] SgfcPrivateConstants.h
    >>> There's no need to test a passive constants container class.
  - SgfcUtility.h
  
- include
  - [OK] ISgfcBoardSizeProperty.h
  - [OK] ISgfcColorPropertyValue.h
  - [DONE] ISgfcCommandLine.h
  - [OK] ISgfcComposedPropertyValue.h
  - [DONE] ISgfcDocument.h
  - [OK] ISgfcDocumentReadResult.h
  - [DONE] ISgfcDocumentReader.h
  - [OK] ISgfcDocumentWriteResult.h
  - [DONE] ISgfcDocumentWriter.h
  - [OK] ISgfcDoublePropertyValue.h
  - [DONE] ISgfcGame.h
  - [OK] ISgfcGameTypeProperty.h
  - [DONE] ISgfcGoMove.h
  - [OK] ISgfcGoMovePropertyValue.h
  - [DONE] ISgfcGoPoint.h
  - [OK] ISgfcGoPointPropertyValue.h
  - [DONE] ISgfcGoStone.h
  - [OK] ISgfcGoStonePropertyValue.h
  - [DONE] ISgfcMessage.h
  - [OK] ISgfcMovePropertyValue.h
  - [DONE] ISgfcNode.h
  - [OK] ISgfcNumberPropertyValue.h
  - [OK] ISgfcPointPropertyValue.h
  - [OK] ISgfcProperty.h
  - ISgfcPropertyFactory.h
  - ISgfcPropertyValue.h
  - ISgfcPropertyValueFactory.h
  - [OK] ISgfcRealPropertyValue.h
  - [DONE] ISgfcSgfContent.h
  - [OK] ISgfcSimpleTextPropertyValue.h
  - [OK] ISgfcSinglePropertyValue.h
  - [OK] ISgfcStonePropertyValue.h
  - [OK] ISgfcTextPropertyValue.h
  - [DONE] ISgfcTreeBuilder.h
  - [OK] SgfcBoardSize.h
    >>> Relatively simple data container, with a bit of logic. Might be worth adding tests later.
  - [DONE] SgfcColor.h
  - [DONE] SgfcConstants.h
  - [DONE] SgfcCoordinateSystem.h
  - [DONE] SgfcDouble.h
  - [DONE] SgfcExitCode.h
  - [DONE] SgfcGameType.h
  - [DONE] SgfcGoPointNotation.h
  - [DONE] SgfcMessageType.h
  - SgfcPlusPlusFactory.h
  - [DONE] SgfcPropertyType.h
  - [DONE] SgfcPropertyValueType.h
  - [DONE] SgfcTypedefs.h
- sgfc
  - ?
@herzbube herzbube added the enhancement New feature or request label Sep 21, 2020
@herzbube herzbube self-assigned this Sep 21, 2020
@herzbube
Copy link
Owner Author

Document tags. Example: [filesystem] = all tests that interact with the filesystem.

To exclude a tag: ./test/libsgfc++-test "~[filesystem]"

@herzbube
Copy link
Owner Author

Make a test that makes use of every public type, to verify that all types are exported on Windows.

@herzbube
Copy link
Owner Author

Loading and saving SGF content have been implemented. Add tests for

  • SgfcCommandLine::LoadSgfContent
  • SgfcCommandLine::SaveSgfContent
  • SgfcDocumentReader::ReadSgfContent
  • SgfcDocumentWriter::WriteSgfContent

@herzbube herzbube added this to the 1.0 milestone Sep 27, 2020
@herzbube herzbube added testing and removed enhancement New feature or request labels Nov 6, 2020
@herzbube herzbube removed this from the 1.0 milestone Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant