mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 18:51:28 +00:00
Updated tests for nsMemStream testing.
This commit is contained in:
parent
182ceecabe
commit
d8fd6aa03f
34
network/cache/nu/tests/cb/cb.mak
vendored
34
network/cache/nu/tests/cb/cb.mak
vendored
@ -97,8 +97,7 @@ LINK32_OBJS= \
|
||||
"$(INTDIR)\cbDoc.obj" \
|
||||
"$(INTDIR)\cbView.obj" \
|
||||
"$(INTDIR)\MainFrm.obj" \
|
||||
"$(INTDIR)\StdAfx.obj" \
|
||||
"..\..\..\..\..\dist\WIN32_D.OBJ\lib\cachelib.lib"
|
||||
"$(INTDIR)\StdAfx.obj"
|
||||
|
||||
"$(OUTDIR)\cb.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
@ -196,8 +195,7 @@ LINK32_OBJS= \
|
||||
"$(INTDIR)\cbDoc.obj" \
|
||||
"$(INTDIR)\cbView.obj" \
|
||||
"$(INTDIR)\MainFrm.obj" \
|
||||
"$(INTDIR)\StdAfx.obj" \
|
||||
"..\..\..\..\..\dist\WIN32_D.OBJ\lib\cachelib.lib"
|
||||
"$(INTDIR)\StdAfx.obj"
|
||||
|
||||
"$(OUTDIR)\cb.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
@ -391,12 +389,18 @@ DEP_CPP_CBVIE=\
|
||||
"..\..\..\..\..\dist\public\cache\nsCacheObject.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsCachePref.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsDiskModule.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsEnumeration.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsIterator.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsMemCacheObject.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsMemModule.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsMemStream.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsMonitorable.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsStream.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\obsolete\protypes.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\prcpucfg.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\prinrval.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\prlog.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\prmon.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\prthread.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\prtypes.h"\
|
||||
".\cb.h"\
|
||||
@ -405,6 +409,7 @@ DEP_CPP_CBVIE=\
|
||||
".\MainFrm.h"\
|
||||
".\nsTimeIt.h"\
|
||||
".\StdAfx.h"\
|
||||
{$(INCLUDE)}"\sys\TYPES.H"\
|
||||
|
||||
NODEP_CPP_CBVIE=\
|
||||
"..\..\..\..\..\dist\public\cache\mcom_db.h"\
|
||||
@ -426,12 +431,20 @@ DEP_CPP_CBVIE=\
|
||||
"..\..\..\..\..\dist\public\cache\nsCacheObject.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsCachePref.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsDiskModule.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsEnumeration.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsIterator.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsMemCacheObject.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsMemModule.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsMemStream.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsMonitorable.h"\
|
||||
"..\..\..\..\..\dist\public\cache\nsStream.h"\
|
||||
"..\..\..\..\..\dist\public\dbm\cdefs.h"\
|
||||
"..\..\..\..\..\dist\public\dbm\mcom_db.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\obsolete\protypes.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\prcpucfg.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\prinrval.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\prlog.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\prmon.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\prthread.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\prtypes.h"\
|
||||
".\cb.h"\
|
||||
@ -447,6 +460,7 @@ NODEP_CPP_CBVIE=\
|
||||
"..\..\..\..\..\dist\public\cache\nsISupports.h"\
|
||||
"..\..\..\..\..\dist\public\dbm\prmacos.h"\
|
||||
"..\..\..\..\..\dist\public\dbm\xp_mcom.h"\
|
||||
"..\..\..\..\..\dist\win32_d.obj\include\protypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cbView.obj" : $(SOURCE) $(DEP_CPP_CBVIE) "$(INTDIR)"\
|
||||
@ -504,18 +518,6 @@ DEP_CPP_CACHE=\
|
||||
"$(INTDIR)\cb.pch"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\work\mozilla\dist\WIN32_D.OBJ\lib\cachelib.lib
|
||||
|
||||
!IF "$(CFG)" == "cb - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "cb - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
|
BIN
network/cache/nu/tests/cb/cb.mdp
vendored
BIN
network/cache/nu/tests/cb/cb.mdp
vendored
Binary file not shown.
23
network/cache/nu/tests/cb/cbView.cpp
vendored
23
network/cache/nu/tests/cb/cbView.cpp
vendored
@ -15,6 +15,7 @@
|
||||
#include "nsCacheObject.h"
|
||||
#include "nsTimeIt.h"
|
||||
#include "nsCacheBkgThd.h"
|
||||
#include "nsMemStream.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
@ -124,6 +125,7 @@ void CCbView::OnInitialUpdate()
|
||||
pCO->LastModified(time(0));
|
||||
pDM->AddObject(pCO);
|
||||
|
||||
/*
|
||||
// if (!pDM->Contains("http://www.netscape.com/"))
|
||||
// pDM->AddObject(pCO);
|
||||
// else
|
||||
@ -155,13 +157,29 @@ void CCbView::OnInitialUpdate()
|
||||
|
||||
m_Mesg += "-----------------\n";
|
||||
|
||||
|
||||
*/
|
||||
char buffer[10];
|
||||
m_Mesg += "Worst case time= ";
|
||||
m_Mesg += itoa(pCM->WorstCaseTime(), buffer, 10);
|
||||
m_Mesg += " microsec.\n";
|
||||
m_Mesg += "Worst case time= ";
|
||||
m_Mesg += itoa(pCM->WorstCaseTime(), buffer, 10);
|
||||
m_Mesg += " microsec.\n";
|
||||
|
||||
PRUint32 t;
|
||||
PRUint32 t;
|
||||
/* Test reading and writing to memory streams */
|
||||
nsMemStream* ms = new nsMemStream();
|
||||
|
||||
t = ms->Write("Hello ", 6);
|
||||
t = ms->Write("World", 5);
|
||||
|
||||
char tempBuff[15];
|
||||
|
||||
t = ms->Read(&tempBuff, 15);
|
||||
t = ms->Read(&tempBuff, 6);
|
||||
|
||||
delete ms;
|
||||
/* Time the lookup time */
|
||||
{
|
||||
nsTimeIt tmp(t);
|
||||
if (pCM->Contains("999"))
|
||||
@ -176,3 +194,4 @@ void CCbView::OnInitialUpdate()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user