rv = NS_InitXPCOM(&servMgr, NULL, NULL);
rv = NS_InitXPCOM(&servMgr, NULL);
main(int argc, char* argv[]){    nsresult rv;    nsIServiceManager* servMgr;    rv = NS_InitXPCOM(&servMgr, NULL, NULL);    if (NS_FAILED(rv)) return rv;    if (argc > 1 && nsCRT::strcmp(argv[1], "-trace") == 0)        gTrace = PR_TRUE;#ifdef DEBUG    TestSegmentedBuffer();#endif#if 0   // obsolete old implementation    rv = NS_NewPipe(&in, &out, PR_TRUE, 4096 * 4);    if (NS_FAILED(rv)) {        printf("NewPipe failed\n");        return -1;    }    rv = TestPipe(in, out);    NS_RELEASE(in);    NS_RELEASE(out);    if (NS_FAILED(rv)) {        printf("TestPipe failed\n");        return -1;    }#endif    TestSearch("foo", 8);    TestSearch("bar", 6);    TestSearch("baz", 2);    rv = TestPipeObserver();    NS_ASSERTION(NS_SUCCEEDED(rv), "TestPipeObserver failed");    rv = TestChainedPipes();    NS_ASSERTION(NS_SUCCEEDED(rv), "TestChainedPipes failed");    RunTests(16, 1);    RunTests(4096, 16);    return 0;}