rv = NS_AutoregisterComponents(); if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIServiceManager> servMan; NS_InitXPCOM2(getter_AddRefs(servMan), nsnull, nsnull); nsCOMPtr<nsIComponentRegistrar> registrar = do_QueryInterface(servMan); NS_ASSERTION(registrar, "Null nsIComponentRegistrar"); registrar->AutoRegister(nsnull);
main(int argc, char* argv[]){    nsresult rv;    if (argc < 2) {        printf("usage: %s <dir-to-read-all-files-from>\n", argv[0]);        return -1;    }    char* dirName = argv[1];    rv = NS_AutoregisterComponents();    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsIFileTransportService> fts =              do_GetService(kFileTransportServiceCID, &rv);    if (NS_FAILED(rv)) return rv;    SerialReadTest(dirName);    //ParallelReadTest(dirName, fts);    fts->ProcessPendingRequests();    printf("duration %d ms, volume %d\n",           PR_IntervalToMilliseconds(gDuration),           gVolume);    gVolume = 0;    return 0;}