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

196 assertion violated in kwprobabilitytabletest #227

Merged
merged 2 commits into from
Apr 10, 2024

Conversation

marcboulle
Copy link
Collaborator

Correction des bugs des tests unitaires

  • finalisation des méthodes du framework (comparaison de fichier)
  • correction des test unitaires de Learning_test
    • fuite mémoire dans KWClass::Test et KWClassDomain::Test
    • assertion dans KWProbabilityTable::Test

Plus au passage, simplification des méthode Insert, Rename, Remove de KWClass et KWClassDomain

  • passage de code retour void plutôt que que boolean: simplification du code existant, pour ces codes retour jamais utilisée
  • controle effectuer par require: pour détecter les bugs plus vite

@marcboulle marcboulle linked an issue Apr 9, 2024 that may be closed by this pull request
@marcboulle marcboulle force-pushed the 196-assertion-violated-in-kwprobabilitytabletest branch from e032fb4 to b19d9ce Compare April 9, 2024 07:56
Copy link
Contributor

@bruno-at-orange bruno-at-orange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@folmos-at-orange folmos-at-orange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a question

Comment on lines 226 to 230
// Parametrage de l'arret pour la memoire
//MemSetAllocIndexExit(3391);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep this commented line ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cela m'a été difficile de trouver l'endroit ou paramétrer cette ligne, puisque le framework GoogleTest ne semble pas avoir de main().
Je vais rajouter un commentaire.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

Ameliorations dans le framework des tests unitaires:
- FileCompareForTest: prise en compte des erreurs dans le cas de nombres de lignes different entre Test et Ref
- TestAndCompareResults: parametrage de l'arrete de la memoire (commente) s'il y a des fuites memoire a identifier

Correction des test unitaires:
- KWClass::Test: nommage des variable de type TextList desormais different de celui des variable de type text
- KWProbabilityTable::Test: correction des methdoes d'initialisation CreateTestAttribute (prise en compte des information des nouveaux prior)

Nouveaux resultats de references pour KWData_KWClass.txt et KWData_KWClassDomain.txt
Contexte:
- les methodes de KWClass et KWClassDomain renvoie false
  - si entite cree ou renomme existe (pour Insert et Rename)
  - si entite detyruite n'existe pas (pour Remove).
- ce comportement a ete source de bug (fuite memoire dans KWClass::CreateClass)
- n'est jamais exploite (sauf quelques rares fois avec bOk = Insert... suivi de assert(bOk)

Amélioration
- passage de ces methode en void
- le controle se fait desormais pas un require
- pas d'impact sur le code existant (sauf quelques rare micro-corrections)

- Methodes concernees
  - KWClassDomain
    - InsertClass
    - RemoveClass
    - DeleteClass
    - RenameClass
    - RenameAttribute
    - InsertDomain
    - RemoveDomain
    - DeleteDomain
    - RenameDomain
  - KWClass
    - InsertAttribute
    - InsertAttributeBefore, InsertAttributeAfter
    - InsertAttributeInBlock
    - RenameAttribute

Tests complets LearningTest passes avec succes
@marcboulle marcboulle force-pushed the 196-assertion-violated-in-kwprobabilitytabletest branch from b19d9ce to a98d58a Compare April 10, 2024 15:26
@marcboulle marcboulle merged commit c76df9a into dev Apr 10, 2024
26 checks passed
@marcboulle marcboulle deleted the 196-assertion-violated-in-kwprobabilitytabletest branch April 10, 2024 15:36
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.

Assertion violated in KWProbabilityTable::Test()
3 participants