Menu

#2 Init and Release as late bound

open
nobody
5
2004-01-11
2004-01-11
No

Before the late bound ..Run(assert) is called in the
cTFTest class.
I suggest that a ..Init(assert) is called.
And afterwards
a ..Release(assert).

Reason:

In one of my test cases i have to create a database
connection, and create two bitmaps before i can run the
test case. And afterwards i have to destroy the bitmaps
and disconnect from database.
It would be nice to remove it from the run function.
At the moment i am calling the init and Release frunction
in the beginning and the end of the run function.
But i belive the test should be as simple as possible, and
with as few lines as possible.

Please comment.

Discussion

  • Jonas Mandahl Pedersen

    sample

     
  • Jonas Mandahl Pedersen

    Logged In: YES
    user_id=945742

    test

     
  • Ulrich C. Müller

    Logged In: YES
    user_id=946616

    really good idea...
    maybe other function names:
    ..Setup()
    ..Cleanup()
    and no assert parameters; its not the sense of Setup() and
    Cleanup() to report assertion errors.

    Setup() and Cleanup() could return false if theiy fail which
    can be reported by the framework directly and would prevent
    a call to ..Run() if Setup() fails.

     
  • Ulrich C. Müller

    Logged In: YES
    user_id=946616

    really good idea...
    maybe other function names:
    ..Setup()
    ..Cleanup()
    and no assert parameters; its not the sense of Setup() and
    Cleanup() to report assertion errors.

    Setup() and Cleanup() could return false if theiy fail which
    can be reported by the framework directly and would prevent
    a call to ..Run() if Setup() fails.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.