diff options
author | larryh%netscape.com <devnull@localhost> | 1999-04-13 22:58:40 +0000 |
---|---|---|
committer | larryh%netscape.com <devnull@localhost> | 1999-04-13 22:58:40 +0000 |
commit | a35aaa00f00a7da185cd8b1e67654366cfbc78dd (patch) | |
tree | 3cdd4cbd670111c151a0041b7ac0f1efe630ca5c | |
parent | 0c53e2b093087fd85e298a51913f9bb7b08c69cf (diff) | |
download | nspr-hg-a35aaa00f00a7da185cd8b1e67654366cfbc78dd.tar.gz |
add coverage for functions that should be called by this test case
-rw-r--r-- | pr/tests/instrumt.c | 19 | ||||
-rw-r--r-- | pr/tests/logger.c | 7 |
2 files changed, 25 insertions, 1 deletions
diff --git a/pr/tests/instrumt.c b/pr/tests/instrumt.c index ee2b33b5..195ac05d 100644 --- a/pr/tests/instrumt.c +++ b/pr/tests/instrumt.c @@ -200,11 +200,27 @@ static void PR_CALLBACK CountSomething( void *arg ) static void CounterTest( void ) { PRThread *t1, *t2, *t3, *t4; + PRIntn i = 0; PR_DEFINE_COUNTER( tc ); + PR_DEFINE_COUNTER( zCounter ); PR_LOG( lm, msgLevel, ("Begin CounterTest")); + /* + ** Test Get and Set of a counter. + ** + */ + PR_CREATE_COUNTER( zCounter, "Atomic", "get/set test", "test get and set of counter" ); + PR_SET_COUNTER( zCounter, 9 ); + PR_GET_COUNTER( i, zCounter ); + if ( i != 9 ) + { + failed = PR_TRUE; + PR_LOG( lm, msgLevel, + ("Counter set/get failed")); + } + activeThreads += 4; PR_CREATE_COUNTER( hCounter, "Atomic", "SMP Tests", "test atomic nature of counter" ); @@ -456,6 +472,9 @@ PRIntn main(PRIntn argc, char *argv[]) printf("PASS\n"); } + + PR_DESTROY_COUNTER( hCounter ); + PR_DestroyMonitor( mon ); PR_TRACE( hTrace, TraceFlow, 0xfff,0,0,0,0,0,0); diff --git a/pr/tests/logger.c b/pr/tests/logger.c index 38780273..ac26de02 100644 --- a/pr/tests/logger.c +++ b/pr/tests/logger.c @@ -103,7 +103,7 @@ static void UserLogStuff( void ) int main(PRIntn argc, const char **argv) { PRThread *thread; - + PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0); PR_STDIO_INIT(); @@ -124,6 +124,11 @@ int main(PRIntn argc, const char **argv) PR_LogPrint("%s logging into %s\n", argv[0], argv[1]); PR_LogPrint("%s creating new thread\n", argv[0]); + + /* + ** Now change buffering. + */ + PR_SetLogBuffering( 65500 ); thread = PR_CreateThread( PR_USER_THREAD, forked, (void*)argv[0], PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, PR_JOINABLE_THREAD, 0); |