SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Dec 1999
    Location
    Pleasanton, CA
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using the Main function

    I'm using the main () in a test script to execute multiple test cases with the FOR loop. Here's the behavior I'm seeing. If I put all the test cases inside the FOR loop, the main () will execute them a number of times. However, if I add an additional test case outside the FOR loop, the main () will only execute that test case and exit the script without running anything below it. Have any of you seen that? Is it possible to use the main() just like in C/C++ or it can only execute one command at a time? Thanks in advance.

    Example:
    main ()
    integer i, iCount=3

    testcase1 ()
    print ("Hello World!") <--- never gets executed
    for (i=0; i<iCount; i++)
    testcase2 ()
    testcase3 ()
    ...
    Wilbur Hsu
    QA Engineer II
    Documentum, Inc. (NASDAQ: DCTM)

  2. #2
    Senior Member
    Join Date
    Jul 1999
    Location
    New York, NY, USA
    Posts
    137
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Using the Main function

    I do this all of the time and never have a problem. Are you sure the indentation is correct? Are you running this directly or from a testplan file? I have never bother to use a .pln file to do it so I'm taking a shot in the dark.

  3. #3
    Junior Member
    Join Date
    Dec 1999
    Location
    Pleasanton, CA
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Using the Main function

    Yes, I'm running it directly using Run>Run or F9. I even tried replacing testcase1 with a function that just prints out a string. main() still exists after the function call and not executing anything below it.
    Wilbur Hsu
    QA Engineer II
    Documentum, Inc. (NASDAQ: DCTM)

  4. #4
    Senior Member
    Join Date
    Sep 1999
    Location
    San Jose,CA,USA
    Posts
    340
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Using the Main function

    Whsu

    I did not have a problem doing this with the following code:

    Even inserting errors into the testcase1 I was always able to run this (int i = 3/0). Why don't you try running this sample code and see what you get .. this is really weird


    ------------------
    "Smoke me a kipper, I'll be back for breakfast!"
    Sincerely
    Richard Weth
    Sr. QA Engineer
    mailto:rick_weth@yahoo.com
    phone(408) 487-3846



    [This message has been edited by rick_weth (edited 01-07-2000).]
    Smoke me a kipper, I'll be back for breakfast!
    Sincerely
    Richard Weth
    Sr. QA Engineer

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:21 PM.

Copyright BetaSoft Inc.