summaryrefslogtreecommitdiff
path: root/tests/Template.c
diff options
context:
space:
mode:
authorrpj <rpj>2000-08-17 14:50:43 +0000
committerrpj <rpj>2000-08-17 14:50:43 +0000
commit88de1621e4371cd118e1a98c9c08ff23c46e6899 (patch)
treed102b28d3c79254798c0214613b547ef95c380f2 /tests/Template.c
parent2ca5c368816d1e48955505e5ecb52a09e3fbe62a (diff)
Removed obsolete files.
Diffstat (limited to 'tests/Template.c')
-rw-r--r--tests/Template.c129
1 files changed, 0 insertions, 129 deletions
diff --git a/tests/Template.c b/tests/Template.c
deleted file mode 100644
index 4bee7e1..0000000
--- a/tests/Template.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * File:
- *
- * Test Synopsis:
- * -
- *
- * Test Method (Validation or Falsification):
- * -
- *
- * Requirements Tested:
- * -
- *
- * Features Tested:
- * -
- *
- * Cases Tested:
- * -
- *
- * Description:
- * -
- *
- * Environment:
- * -
- *
- * Input:
- * - None.
- *
- * Output:
- * - File name, Line number, and failed expression on failure.
- * - No output on success.
- *
- * Assumptions:
- * -
- *
- * Pass Criteria:
- * - Process returns zero exit status.
- *
- * Fail Criteria:
- * - Process returns non-zero exit status.
- */
-
-#include "test.h"
-
-/*
- * Create NUMTHREADS threads in addition to the Main thread.
- */
-enum {
- NUMTHREADS = 2
-};
-
-typedef struct bag_t_ bag_t;
-struct bag_t_ {
- int threadnum;
- int started;
- /* Add more per-thread state variables here */
-};
-
-static bag_t threadbag[NUMTHREADS + 1];
-
-void *
-mythread(void * arg)
-{
- bag_t * bag = (bag_t *) arg;
-
- assert(bag == &threadbag[bag->threadnum]);
- assert(bag->started == 0);
- bag->started = 1;
-
- /* ... */
-
- return 0;
-}
-
-int
-main()
-{
- int failed = 0;
- int i;
- pthread_t t[NUMTHREADS + 1];
-
- assert((t[0] = pthread_self()) != NULL);
-
- for (i = 1; i <= NUMTHREADS; i++)
- {
- threadbag[i].started = 0;
- threadbag[i].threadnum = i;
- assert(pthread_create(&t[i], NULL, mythread, (void *) &threadbag[i]) == 0);
- }
-
- /*
- * Code to control or munipulate child threads should probably go here.
- */
-
-
- /*
- * Give threads time to run.
- */
- Sleep(NUMTHREADS * 1000);
-
- /*
- * Standard check that all threads started.
- */
- for (i = 1; i <= NUMTHREADS; i++)
- {
- failed = !threadbag[i].started;
-
- if (failed)
- {
- fprintf(stderr, "Thread %d: started %d\n", i, threadbag[i].started);
- }
- }
-
- assert(!failed);
-
- /*
- * Check any results here. Set "failed" and only print ouput on failure.
- */
- for (i = 1; i <= NUMTHREADS; i++)
- {
- /* ... */
- }
-
- assert(!failed);
-
- /*
- * Success.
- */
- return 0;
-}