Function testing question

This is a discussion on Function testing question within the C Programming forums, part of the General Programming Boards category; I designed a function for use in a larger program. The function was tested before being implemented and it worked ...

  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    84

    Function testing question

    I designed a function for use in a larger program. The function was tested before being implemented and it worked fine. Now, it was copied into a larger program and was called and I am getting some weird behavior... Any reason for this unexpected behavior? Can memory issues do that? Say if their was a leak?

    I can't share it due to the size but am trying to think, qualitatively, why it would work during testing (simple main function and a call) and not now (where many functions being used/ i and o operations/ etc.).

    Any ideas.

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,163
    We really can't answer this without seeing it or at least knowing something about it. It could be anything from a global variable being changed unexpectedly to mishandled memory management.
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User
    Join Date
    May 2010
    Location
    Naypyidaw
    Posts
    1,314
    So when you do unit testing, the code is OK?
    Any warning that you're ignoring? (un-initalized variable,pointer..?).
    If you post the code, we will be able to look into more details...

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    There could be any one of a thousand reasons for your problem. This is where good troubleshooting skills come into play... one must not simply boggle when the things don't go as expected.

    As the others have already said, there's not much we can do without (at minimum) a detailed description of the exact problem.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question: Can a function be nameless?
    By Omega Metroid in forum C++ Programming
    Replies: 20
    Last Post: 09-29-2009, 05:48 PM
  2. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  3. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  4. dllimport function not allowed
    By steve1_rm in forum C++ Programming
    Replies: 5
    Last Post: 03-11-2008, 03:33 AM
  5. Replies: 28
    Last Post: 07-16-2006, 11:35 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21