TestPipes.cpp File Reference


Classes

class  nsReceiver
class  nsShortReader

Functions

 NS_IMPL_THREADSAFE_ISUPPORTS1 (nsReceiver, nsIRunnable) nsresult TestPipe(nsIInputStream *in
 if (receiver==nsnull) return NS_ERROR_OUT_OF_MEMORY
 NS_ADDREF (receiver)
 if (NS_FAILED(rv)) return rv
 for (PRUint32 i=0;i< ITERATIONS;i++)
thread Shutdown ()
 printf ("wrote %d bytes, time = %dms\n", total, PR_IntervalToMilliseconds(end-start))
 NS_ASSERTION (receiver->GetBytesRead()==total,"didn't read everything")
 NS_RELEASE (thread)
 NS_RELEASE (receiver)
 NS_IMPL_THREADSAFE_ISUPPORTS1 (nsShortReader, nsIRunnable) nsresult TestShortWrites(nsIInputStream *in
 NS_IMPL_THREADSAFE_ISUPPORTS1 (nsPump, nsIRunnable) nsresult TestChainedPipes()
void RunTests (PRUint32 segSize, PRUint32 segCount)
void TestSearch (const char *delim, PRUint32 segSize)
NS_COM void TestSegmentedBuffer ()
int main (int argc, char *argv[])
 gess12/20/98

Variables

char kTestPattern [] = "My hovercraft is full of eels.\n"
PRBool gTrace = PR_FALSE
nsIOutputStream *out nsresult rv = NS_NewThread(&thread, receiver)
nsIThreadthread
nsReceiverreceiver = new nsReceiver(in)
PRUint32 total = 0
PRIntervalTime start = PR_IntervalNow()
PRIntervalTime end = PR_IntervalNow()
return NS_OK


Function Documentation

NS_IMPL_THREADSAFE_ISUPPORTS1 ( nsReceiver  ,
nsIRunnable   
)

if ( receiver  = =nsnull  ) 

NS_ADDREF ( receiver   ) 

if ( NS_FAILED(rv  ) 

for (  ) 

thread Shutdown (  ) 

printf ( "wrote %d   bytes  ) 

NS_ASSERTION ( receiver->  GetBytesRead() = =total,
"didn't read everything"   
)

NS_RELEASE ( thread   ) 

NS_RELEASE ( receiver   ) 

NS_IMPL_THREADSAFE_ISUPPORTS1 ( nsShortReader  ,
nsIRunnable   
)

NS_IMPL_THREADSAFE_ISUPPORTS1 ( nsPump  ,
nsIRunnable   
)

void RunTests ( PRUint32  segSize,
PRUint32  segCount 
)

void TestSearch ( const char delim,
PRUint32  segSize 
)

NS_COM void TestSegmentedBuffer (  ) 

int main ( int  argc,
char argv[] 
)

Parameters:
@return 

Create event queue for this thread

Test Cache


Variable Documentation

char kTestPattern[] = "My hovercraft is full of eels.\n"

PRBool gTrace = PR_FALSE

rv = NS_NewThread(&thread, receiver)

PRIntervalTime start = PR_IntervalNow()

PRIntervalTime end = PR_IntervalNow()

return NS_OK


Generated Mozilla by doxygen 1.5.6