Thread: Unite Testing in c

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Oct 2022
    Posts
    96

    Unite Testing in c

    I'm currently trying to grasp the concept of unit testing, particularly in the context of c program. I've gone through some resources, but I'm still struggling to fully understand how to apply it practically.

    Embedded C/C++ Unit Testing Basics - GeeksforGeeks

    From what I gather, unit testing is important for identifying bugs and errors in code. However, I'm having trouble figuring out the process of implementing unit testing for a program.

    Take a simple example

    Code:
      #include<stdio.h>
    
    int ADD ( int x, int y);
    
    int main()
    {
        int a = 10;
        int b = 2;
        int result;
        
        result = ADD ( a, b);
        
        printf(" Result : %d", result);
        
        return 0;
    }
    
    int ADD ( int x, int y)
    {
        int r = x + y;
        return r;
    }
    Could someone kindly provide a straightforward explanation or perhaps a simple example to illustrate how unit testing works?
    Last edited by Kittu20; 02-04-2024 at 10:23 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 09-15-2013, 03:19 PM
  2. Testing ~bit
    By JeremyCAFE in forum C++ Programming
    Replies: 5
    Last Post: 01-05-2006, 03:20 PM
  3. Newbie Game Develpoers Unite!
    By Telenosis in forum Game Programming
    Replies: 10
    Last Post: 06-22-2002, 02:02 PM
  4. Testing Testing 123.. Oh yeah and...
    By minime6696 in forum Windows Programming
    Replies: 0
    Last Post: 08-13-2001, 09:07 AM

Tags for this Thread