git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2491 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
joostverburg 2003-04-23 18:57:53 +00:00
parent 242db0e252
commit d0b6153cf2

View file

@ -1,27 +1,44 @@
; rtest.nsi
;
; This script tests some advanced NSIS functions.
;--------------------------------
Name "rtest" Name "rtest"
OutFile "rtest.exe" OutFile "rtest.exe"
InstallDir $TEMP
BGGradient 0 FFFF00 00FFFF
DirShow hide DirShow hide
ComponentText "select tests." ComponentText "Select tests!"
ShowInstDetails show
;--------------------------------
Section "Test 1"
Section "test 1"
StrCpy $0 "a" StrCpy $0 "a"
Call test1 Call test1
StrCmp $0 "a182345678" success StrCmp $0 "a182345678" success
DetailPrint "Test 1 failed (output: $0)" DetailPrint "Test 1 failed (output: $0)"
Goto end Goto end
success: success:
DetailPrint "Test 1 succeded (output: $0)" DetailPrint "Test 1 succeded (output: $0)"
end: end:
SectionEnd SectionEnd
Function test1 Function test1
GetLabelAddress $9 skip8
GetLabelAddress $9 skip
IntOp $9 $9 - 1 IntOp $9 $9 - 1
StrCpy $0 $01 StrCpy $0 $01
Call $9 Call $9
StrCpy $0 $02 StrCpy $0 $02
StrCpy $0 $03 StrCpy $0 $03
StrCpy $0 $04 StrCpy $0 $04
@ -29,28 +46,44 @@ StrCpy $0 $05
StrCpy $0 $06 StrCpy $0 $06
StrCpy $0 $07 StrCpy $0 $07
StrCpy $0 $08 StrCpy $0 $08
skip8:
skip:
FunctionEnd FunctionEnd
Section "test 2" ;--------------------------------
Section "Test 2"
StrCpy $0 "0" StrCpy $0 "0"
StrCpy $1 "11" StrCpy $1 "11"
GetFunctionAddress $9 test2
Call $9 Call test2
StrCmp $1 "11,10,9,8,7,6,5,4,3,2,1" success StrCmp $1 "11,10,9,8,7,6,5,4,3,2,1" success
DetailPrint "Test 2 failed (output: $1)" DetailPrint "Test 2 failed (output: $1)"
Goto end Goto end
success: success:
DetailPrint "Test 2 succeded (output: $1)" DetailPrint "Test 2 succeded (output: $1)"
end: end:
SectionEnd SectionEnd
Function test2 Function test2
IntOp $0 $0 + 1 IntOp $0 $0 + 1
IntCmp $0 10 done IntCmp $0 10 done
Push $0 Push $0
Call test2 Call test2
Pop $0 Pop $0
done: done:
StrCpy $1 "$1,$0" StrCpy $1 "$1,$0"
FunctionEnd FunctionEnd