rv = NS_InitXPCOM(&servMgr, NULL, NULL);
rv = NS_InitXPCOM(&servMgr, NULL);
main(int argc, char* argv[]){    nsresult rv;    nsIServiceManager* servMgr;    if (argc >= 2 && nsCRT::strcmp(argv[1], "-verbose") == 0) {        gVerbose = PR_TRUE;    }    rv = NS_InitXPCOM(&servMgr, NULL, NULL);    if (NS_FAILED(rv)) return rv;    rv = TestWriteSegments(NS_OK);    NS_ASSERTION(NS_SUCCEEDED(rv), "TestWriteSegments failed");    rv = TestWriteSegments(NS_ERROR_FAILURE);    NS_ASSERTION(NS_SUCCEEDED(rv), "TestWriteSegments failed");    rv = TestWriteSegments(NS_BASE_STREAM_CLOSED);    NS_ASSERTION(NS_SUCCEEDED(rv), "TestWriteSegments failed");    rv = TestWriteSegments(NS_BASE_STREAM_WOULD_BLOCK);    NS_ASSERTION(NS_SUCCEEDED(rv), "TestWriteSegments failed");    rv = TestReadSegments(NS_OK);    NS_ASSERTION(NS_SUCCEEDED(rv), "TestReadSegments failed");    rv = TestReadSegments(NS_ERROR_FAILURE);    NS_ASSERTION(NS_SUCCEEDED(rv), "TestReadSegments failed");//    rv = TestReadSegments(NS_BASE_STREAM_CLOSED);//    NS_ASSERTION(NS_SUCCEEDED(rv), "TestReadSegments failed");    rv = TestReadSegments(NS_BASE_STREAM_WOULD_BLOCK);    NS_ASSERTION(NS_SUCCEEDED(rv), "TestReadSegments failed");    rv = TestMallocBuffers(1, 1);    NS_ASSERTION(NS_SUCCEEDED(rv), "TestMallocBuffers failed");    rv = TestPageBuffers(1, 1);    NS_ASSERTION(NS_SUCCEEDED(rv), "TestPageBuffers failed");    rv = TestMallocBuffers(1, 10);    NS_ASSERTION(NS_SUCCEEDED(rv), "TestMallocBuffers failed");    rv = TestPageBuffers(1, 10);    NS_ASSERTION(NS_SUCCEEDED(rv), "TestPageBuffers failed");    rv = TestMallocBuffers(5, 10);    NS_ASSERTION(NS_SUCCEEDED(rv), "TestMallocBuffers failed");    rv = TestPageBuffers(5, 10);    NS_ASSERTION(NS_SUCCEEDED(rv), "TestPageBuffers failed");    TestSearch("foo", 8);    TestSearch("bar", 6);    TestSearch("baz", 2);    return 0;}