diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2007-04-03 03:49:53 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2007-04-03 03:49:53 +0000 |
| commit | f4c20290509d7ed3a8fd5304577e7a4cc0b9d974 (patch) | |
| tree | 13cdf64f7cf134f397a7165b7a3fe0807e37026b /src/tests/param.cpp | |
| parent | 74d4c8cd27334fc7204d5a8773deb3d424565778 (diff) | |
| download | libbu++-f4c20290509d7ed3a8fd5304577e7a4cc0b9d974.tar.gz libbu++-f4c20290509d7ed3a8fd5304577e7a4cc0b9d974.tar.bz2 libbu++-f4c20290509d7ed3a8fd5304577e7a4cc0b9d974.tar.xz libbu++-f4c20290509d7ed3a8fd5304577e7a4cc0b9d974.zip | |
Ok, no code is left in src, it's all in src/old. We'll gradually move code back
into src as it's fixed and re-org'd. This includes tests, which, I may write a
unit test system into libbu++ just to make my life easier.
Diffstat (limited to 'src/tests/param.cpp')
| -rw-r--r-- | src/tests/param.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/tests/param.cpp b/src/tests/param.cpp deleted file mode 100644 index a4d2824..0000000 --- a/src/tests/param.cpp +++ /dev/null | |||
| @@ -1,46 +0,0 @@ | |||
| 1 | #include "param.h" | ||
| 2 | #include <stdio.h> | ||
| 3 | |||
| 4 | Param::Param() | ||
| 5 | { | ||
| 6 | addHelpBanner("param - A test of the libbu++ parameter systems\n" | ||
| 7 | "Enjoy with care and caution\n\nTest stuff:\n"); | ||
| 8 | addParam( "name", 's', mkproc( Param::printStuff ), &str, "Test a param param" ); | ||
| 9 | //addParam( "name", &str ); | ||
| 10 | addParam( "job", 'U', mkproc( Param::printStuff ), "Test a paramless param" ); | ||
| 11 | |||
| 12 | addHelpBanner("\nInformational:\n"); | ||
| 13 | addParam( "help", mkproc( ParamProc::help ), "Help!" ); | ||
| 14 | |||
| 15 | addHelpBanner("\nThanks for trying my test!\n\n"); | ||
| 16 | } | ||
| 17 | |||
| 18 | Param::~Param() | ||
| 19 | { | ||
| 20 | } | ||
| 21 | |||
| 22 | int Param::printStuff( int argc, char *argv[] ) | ||
| 23 | { | ||
| 24 | printf("------------%02d-------------\n", argc ); | ||
| 25 | for( int j = 0; j < argc; j++ ) | ||
| 26 | { | ||
| 27 | printf("%d: %s\n", j, argv[j] ); | ||
| 28 | } | ||
| 29 | printf("---------------------------\n" ); | ||
| 30 | printf("SETVAR===\"%s\"\n", str.c_str() ); | ||
| 31 | |||
| 32 | return 1; | ||
| 33 | } | ||
| 34 | |||
| 35 | int main( int argc, char *argv[] ) | ||
| 36 | { | ||
| 37 | if( argc == 1 ) | ||
| 38 | { | ||
| 39 | printf("You have to enter some parameter, try '--help'\n\n"); | ||
| 40 | return 0; | ||
| 41 | } | ||
| 42 | |||
| 43 | Param p; | ||
| 44 | p.process( argc, argv ); | ||
| 45 | } | ||
| 46 | |||
