source: git/factory/ftest/insert.m4 @ fa8420

spielwiese
Last change on this file since fa8420 was fa8420, checked in by Jens Schmidt <schmidt@…>, 25 years ago
***** merge from branch `factory-gcd' to main trunk git-svn-id: file:///usr/local/Singular/svn/trunk@1328 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id: insert.m4,v 1.2 1998-04-06 10:48:37 schmidt Exp $ */
3
4ftestSetNameOfGame( insert, `"
5Usage: insert [<options>] [<envSpec>] <f> <g> [<v>]
6  inserts canonical form <g> for variable <v> in canonical form
7  <f>.  <v> defaults to main variable of <f> if not explicitely
8  specified.
9"'`' )
10
11//{{{ docu
12//
13// ftestAlgorithm.m4 - ftestAlgorithm test program.
14//
15// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
16// the following way:
17//
18// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
19//
20//}}}
21
22ftestPreprocInit();
23
24ftestGlobalInit();
25
26//
27// - main program.
28//
29int
30main ( int argc, char ** argv )
31{
32    // initialization
33    ftestMainInit();
34
35    // declare input and output variables
36    ftestOutVar( CanonicalForm, result );
37    ftestInVar( CanonicalForm, f );
38    ftestInVar( CanonicalForm, g );
39    ftestInVar( Variable, v );
40
41    // process argument list and set environment
42    ftestGetOpts();
43    ftestGetEnv();
44    ftestGetInVar( f );
45    ftestGetInVar( g );
46    ftestGetInVar( v, f.mvar() );
47
48    // do the test!
49    if ( ftestArgGiven( v ) ) {
50        ftestRun( result = f( g, v ); );
51    } else {
52        ftestRun( result = f( g ); );
53    }
54
55    // print results
56    if ( ftestArgGiven( v ) ) {
57        ftestOutput( "f(g, v)", result );
58    } else {
59        ftestOutput( "f(g)", result );
60    }
61
62    // clean up
63    ftestMainExit();
64}
Note: See TracBrowser for help on using the repository browser.