Test Program

This is just a simple program written in order to test a simple literate programming tool we are designing. In it, sections will receive parameters.

Files to Include
Silly Function
Main Function

Files to Include

We use stdlib.h for exit and EXIT_SUCCESS

#include <stdio.h>
#include <stdlib.h>

Perform Assertion ( value, file, line )

This code is used in order to check that "value" is nonzero. This will help a lot while debugging our code.


if(!(<value>))
  {
    printf("(%s,%d): Assert Failed\n",<file>, <line>);
    exit(EXIT_FAILURE);
  }

Silly Function

This function returns a value between 0 and x. x cannot be 0.


int
silly(int x)
{
  Perform Assertion ( x, "test.lw", 40 )
return x+1; }

Main Function

This is the main function.

int
main (int argc, char **argv)
{
  silly(1);
  silly(0);
  return EXIT_SUCCESS;
}