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
This commit is contained in:
parent
ba8a64a806
commit
ca1929afb7
2 changed files with 30 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include "../strlist.h"
|
||||
#include "../mmap.h"
|
||||
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
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 );
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( MMapTest );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue