From ca1929afb719c46e0d2e71bf1b1ce00f22278c8f Mon Sep 17 00:00:00 2001 From: kichik Date: Sat, 2 Oct 2004 18:26:23 +0000 Subject: [PATCH] use mmap.cpp instead of strlist.h git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3696 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/Tests/Tests.dsp | 29 ++++++++++++++++++++++++++--- Source/Tests/mmap.cpp | 9 ++++----- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/Source/Tests/Tests.dsp b/Source/Tests/Tests.dsp index 721173a5..ebeca2b4 100644 --- a/Source/Tests/Tests.dsp +++ b/Source/Tests/Tests.dsp @@ -87,6 +87,29 @@ LINK32=link.exe # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Group "Linked" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\growbuf.cpp +# End Source File +# Begin Source File + +SOURCE=..\mmap.cpp + +!IF "$(CFG)" == "Tests - Win32 Release" + +# PROP Intermediate_Dir "Release\Linked" + +!ELSEIF "$(CFG)" == "Tests - Win32 Debug" + +# PROP Intermediate_Dir "Debug\Linked" + +!ENDIF + +# End Source File +# End Group # Begin Source File SOURCE=.\endian.cpp @@ -103,10 +126,10 @@ SOURCE=.\textrunner.cpp # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" +# Begin Source File -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +SOURCE=..\mmap.h +# End Source File # End Group # End Target # End Project diff --git a/Source/Tests/mmap.cpp b/Source/Tests/mmap.cpp index e65b2220..f6f87770 100644 --- a/Source/Tests/mmap.cpp +++ b/Source/Tests/mmap.cpp @@ -1,11 +1,10 @@ #include -#include "../strlist.h" +#include "../mmap.h" #include #include #include -int MMapFile::m_iAllocationGranularity = 0; int g_display_errors = 1; FILE *g_output = stderr; @@ -33,7 +32,7 @@ public: srand(time(NULL)); - for (int i = 0; i < 100; i++) { + for (size_t i = 0; i < 100; i++) { int offset1 = rand() % BUF_SIZE; int size1 = rand() % (BUF_SIZE - offset1); char *p1 = (char *) mmap.get(offset1, size1); @@ -43,7 +42,7 @@ public: char *p2 = (char *) mmap.getmore(offset2, &size2); int minsize = min(size1, size2); - for (int j = 0; j < minsize; j++) { + for (size_t j = 0; j < minsize; j++) { CPPUNIT_ASSERT_EQUAL( p1[j], p2[j] ); } @@ -54,4 +53,4 @@ public: }; -CPPUNIT_TEST_SUITE_REGISTRATION( MMapTest ); \ No newline at end of file +CPPUNIT_TEST_SUITE_REGISTRATION( MMapTest );