diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-04-10 16:02:07 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-04-10 16:02:07 +0000 |
commit | b6e100b94b12f3f92ec025dc2363eaf7c0ee6662 (patch) | |
tree | 7fa6f7c9450f0ef866e50e1d096ad854a5892aa0 /src/fstring.h | |
parent | 5a0d7856dc265580cebaa833e0367d03ef21bbc3 (diff) | |
download | libbu++-b6e100b94b12f3f92ec025dc2363eaf7c0ee6662.tar.gz libbu++-b6e100b94b12f3f92ec025dc2363eaf7c0ee6662.tar.bz2 libbu++-b6e100b94b12f3f92ec025dc2363eaf7c0ee6662.tar.xz libbu++-b6e100b94b12f3f92ec025dc2363eaf7c0ee6662.zip |
Well, we've got the basis of a workable unit test harness thing. There should
be a few more add-ons to it, but it works just fine, and eventually it should
cover command line options and creating logs, and possibly even provide output
functionality so that output from tests can be logged and kept track of well.
Diffstat (limited to '')
-rw-r--r-- | src/fstring.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/fstring.h b/src/fstring.h index 0184301..751beb8 100644 --- a/src/fstring.h +++ b/src/fstring.h | |||
@@ -364,6 +364,30 @@ namespace Bu | |||
364 | } | 364 | } |
365 | } | 365 | } |
366 | 366 | ||
367 | long find( const char *sText ) | ||
368 | { | ||
369 | long nTLen = strlen( sText ); | ||
370 | flatten(); | ||
371 | for( long j = 0; j < pFirst->nLength-nTLen; j++ ) | ||
372 | { | ||
373 | if( !strncmp( sText, pFirst->pData+j, nTLen ) ) | ||
374 | return j; | ||
375 | } | ||
376 | return -1; | ||
377 | } | ||
378 | |||
379 | long rfind( const char *sText ) | ||
380 | { | ||
381 | long nTLen = strlen( sText ); | ||
382 | flatten(); | ||
383 | for( long j = pFirst->nLength-nTLen-1; j >= 0; j-- ) | ||
384 | { | ||
385 | if( !strncmp( sText, pFirst->pData+j, nTLen ) ) | ||
386 | return j; | ||
387 | } | ||
388 | return -1; | ||
389 | } | ||
390 | |||
367 | void archive( class Archive &ar ) | 391 | void archive( class Archive &ar ) |
368 | { | 392 | { |
369 | if( ar.isLoading() ) | 393 | if( ar.isLoading() ) |