aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkate.ward <kate.ward@forestent.com>2013-01-15 00:13:10 +0000
committerkate.ward <kate.ward@forestent.com>2013-01-15 00:13:10 +0000
commitd87a1d9dd5c5b5152c61ca49ce1aea01aace10e9 (patch)
tree3a0cf2ba4a0ea88b285cfa9d68852838f7cd45ed
parent691f3d1ecb5f8d4b89848cd16fdfb6126e227984 (diff)
downloadshflags-d87a1d9dd5c5b5152c61ca49ce1aea01aace10e9.tar.gz
fixed math bug on FreeBSD-9.1; retested
-rw-r--r--source/1.0/src/shflags2
-rwxr-xr-xsource/1.0/src/shflags_test_private.sh8
-rw-r--r--source/1.0/test_results/1.0.4/FreeBSD-9.1.txt27
-rw-r--r--source/1.0/test_results/1.0.4/Linux-Ubuntu-10.04.4-LTS.txt2
-rw-r--r--source/1.0/test_results/1.0.4/Linux-Ubuntu-12.04.1-LTS.txt2
-rw-r--r--source/1.0/test_results/1.0.4/Linux-Ubuntu-8.04.4-LTS.txt2
-rw-r--r--source/1.0/test_results/1.0.4/Mac_OS_X-10.8.2.txt2
-rw-r--r--source/1.0/test_results/1.0.4/OpenSolaris-2009.06(snv_111b).txt2
-rw-r--r--source/1.0/test_results/1.0.4/Solaris-10u10.txt2
-rw-r--r--source/1.0/test_results/1.0.4/Solaris-8u7.txt2
-rw-r--r--source/1.0/test_results/1.0.4/Solaris-9u8.txt2
11 files changed, 36 insertions, 17 deletions
diff --git a/source/1.0/src/shflags b/source/1.0/src/shflags
index b77a6ab..726b206 100644
--- a/source/1.0/src/shflags
+++ b/source/1.0/src/shflags
@@ -709,7 +709,7 @@ _flags_parseGetopt()
# properly give user access to non-flag arguments mixed in between flag
# arguments. Its usage was replaced by FLAGS_ARGV, and it is being kept only
# for backwards compatibility reasons.
- FLAGS_ARGC=`_flags_math $# - 1 - ${_flags_argc_}`
+ FLAGS_ARGC=`_flags_math "$# - 1 - ${_flags_argc_}"`
# handle options. note options with values must do an additional shift
while true; do
diff --git a/source/1.0/src/shflags_test_private.sh b/source/1.0/src/shflags_test_private.sh
index 899f5df..d5c6112 100755
--- a/source/1.0/src/shflags_test_private.sh
+++ b/source/1.0/src/shflags_test_private.sh
@@ -168,15 +168,15 @@ testValidIntExpr()
_testMath()
{
- result=`_flags_math 1 + 1`
- assertTrue '1+1 failed' $?
- assertEquals '1+1' 2 ${result}
+ result=`_flags_math 1`
+ assertTrue '1 failed' $?
+ assertEquals '1' 1 ${result}
result=`_flags_math '1 + 2'`
assertTrue '1+2 failed' $?
assertEquals '1+2' 3 ${result}
- result=`_flags_math 1 + 2 + 3`
+ result=`_flags_math '1 + 2 + 3'`
assertTrue '1+2+3 failed' $?
assertEquals '1+2+3' 6 ${result}
diff --git a/source/1.0/test_results/1.0.4/FreeBSD-9.1.txt b/source/1.0/test_results/1.0.4/FreeBSD-9.1.txt
index 6d4bd4e..9980680 100644
--- a/source/1.0/test_results/1.0.4/FreeBSD-9.1.txt
+++ b/source/1.0/test_results/1.0.4/FreeBSD-9.1.txt
@@ -8,7 +8,7 @@ tests=" shflags_test_defines.sh shflags_test_parsing.sh shflags_test_private.sh
# system info
$ date
-Fri Jan 4 22:15:59 UTC 2013
+Tue Jan 15 00:08:36 UTC 2013
$ uname -mprsv
FreeBSD 9.1-RELEASE FreeBSD 9.1-RELEASE #0: Fri Dec 7 20:50:48 GMT 2012 kirk@freenas:/usr/obj/usr/src/sys/GENERIC amd64 amd64
@@ -38,10 +38,25 @@ testGetoptStandard
testGetoptEnhanced
testValidBoolsShort
testValidBoolsLong
+testValidFloats
+testInvalidFloats
+testValidIntegers
+testInvalidIntegers
+testValidStrings
+testMultipleFlags
+testSingleNonFlagArg
+testMultipleNonFlagArgs
+testMultipleNonFlagStringArgsWithSpaces
+testFlagsWithEquals
+testComplicatedCommandLineStandard
+testComplicatedCommandLineEnhanced
+
+Ran 16 tests.
+
+OK
--- Executing the 'private' test suite ---
testColumns
-testExpr
testGenOptStr
testGetFlagInfo
testItemInList
@@ -50,8 +65,12 @@ testValidFloatBuiltin
testValidFloatExpr
testValidIntBuiltin
testValidIntExpr
+testMathBuiltin
+testMathExpr
+testStrlenBuiltin
+testStrlenExpr
-Ran 10 tests.
+Ran 13 tests.
OK
@@ -64,7 +83,7 @@ testNoHelp
Ran 4 tests.
-OK (skipped=7)
+OK (skipped=5)
#------------------------------------------------------------------------------
diff --git a/source/1.0/test_results/1.0.4/Linux-Ubuntu-10.04.4-LTS.txt b/source/1.0/test_results/1.0.4/Linux-Ubuntu-10.04.4-LTS.txt
index b99175e..4dc2fb5 100644
--- a/source/1.0/test_results/1.0.4/Linux-Ubuntu-10.04.4-LTS.txt
+++ b/source/1.0/test_results/1.0.4/Linux-Ubuntu-10.04.4-LTS.txt
@@ -8,7 +8,7 @@ tests=" shflags_test_defines.sh shflags_test_parsing.sh shflags_test_private.sh
# system info
$ date
-Mon Jan 14 23:54:30 UTC 2013
+Tue Jan 15 00:09:41 UTC 2013
$ uname -mprsv
Linux 2.6.32-45-server #101-Ubuntu SMP Mon Dec 3 15:54:27 UTC 2012 x86_64 unknown
diff --git a/source/1.0/test_results/1.0.4/Linux-Ubuntu-12.04.1-LTS.txt b/source/1.0/test_results/1.0.4/Linux-Ubuntu-12.04.1-LTS.txt
index c505c92..c3a2a0d 100644
--- a/source/1.0/test_results/1.0.4/Linux-Ubuntu-12.04.1-LTS.txt
+++ b/source/1.0/test_results/1.0.4/Linux-Ubuntu-12.04.1-LTS.txt
@@ -8,7 +8,7 @@ tests=" shflags_test_defines.sh shflags_test_parsing.sh shflags_test_private.sh
# system info
$ date
-Mon Jan 14 23:58:49 GMT 2013
+Tue Jan 15 00:09:47 GMT 2013
$ uname -mprsv
Linux 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 x86_64 x86_64
diff --git a/source/1.0/test_results/1.0.4/Linux-Ubuntu-8.04.4-LTS.txt b/source/1.0/test_results/1.0.4/Linux-Ubuntu-8.04.4-LTS.txt
index 83ab536..62d42f8 100644
--- a/source/1.0/test_results/1.0.4/Linux-Ubuntu-8.04.4-LTS.txt
+++ b/source/1.0/test_results/1.0.4/Linux-Ubuntu-8.04.4-LTS.txt
@@ -8,7 +8,7 @@ tests=" shflags_test_defines.sh shflags_test_parsing.sh shflags_test_private.sh
# system info
$ date
-Mon Jan 14 17:54:42 CST 2013
+Mon Jan 14 18:09:57 CST 2013
$ uname -mprsv
Linux 2.6.24-32-server #1 SMP Mon Dec 3 15:54:12 UTC 2012 x86_64 unknown
diff --git a/source/1.0/test_results/1.0.4/Mac_OS_X-10.8.2.txt b/source/1.0/test_results/1.0.4/Mac_OS_X-10.8.2.txt
index 6bb9dff..c03b407 100644
--- a/source/1.0/test_results/1.0.4/Mac_OS_X-10.8.2.txt
+++ b/source/1.0/test_results/1.0.4/Mac_OS_X-10.8.2.txt
@@ -8,7 +8,7 @@ tests=" shflags_test_defines.sh shflags_test_parsing.sh shflags_test_private.sh
# system info
$ date
-Tue Jan 15 00:52:58 CET 2013
+Tue Jan 15 01:10:24 CET 2013
$ uname -mprsv
Darwin 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64 i386
diff --git a/source/1.0/test_results/1.0.4/OpenSolaris-2009.06(snv_111b).txt b/source/1.0/test_results/1.0.4/OpenSolaris-2009.06(snv_111b).txt
index 1fff128..250dd52 100644
--- a/source/1.0/test_results/1.0.4/OpenSolaris-2009.06(snv_111b).txt
+++ b/source/1.0/test_results/1.0.4/OpenSolaris-2009.06(snv_111b).txt
@@ -8,7 +8,7 @@ tests=" shflags_test_defines.sh shflags_test_parsing.sh shflags_test_private.sh
# system info
$ date
-Mon Jan 14 23:53:49 GMT 2013
+Tue Jan 15 00:08:39 GMT 2013
$ uname -mprsv
SunOS 5.11 snv_111b i86pc i386
diff --git a/source/1.0/test_results/1.0.4/Solaris-10u10.txt b/source/1.0/test_results/1.0.4/Solaris-10u10.txt
index 67d8613..ee3083b 100644
--- a/source/1.0/test_results/1.0.4/Solaris-10u10.txt
+++ b/source/1.0/test_results/1.0.4/Solaris-10u10.txt
@@ -8,7 +8,7 @@ tests=" shflags_test_defines.sh shflags_test_parsing.sh shflags_test_private.sh
# system info
$ date
-Tue Jan 15 00:55:19 MET 2013
+Tue Jan 15 01:09:38 MET 2013
$ uname -mprsv
SunOS 5.10 Generic_147441-01 i86pc i386
diff --git a/source/1.0/test_results/1.0.4/Solaris-8u7.txt b/source/1.0/test_results/1.0.4/Solaris-8u7.txt
index 82f84b6..754672c 100644
--- a/source/1.0/test_results/1.0.4/Solaris-8u7.txt
+++ b/source/1.0/test_results/1.0.4/Solaris-8u7.txt
@@ -8,7 +8,7 @@ tests=" shflags_test_defines.sh shflags_test_parsing.sh shflags_test_private.sh
# system info
$ date
-Mon Jan 14 23:55:15 GMT 2013
+Tue Jan 15 00:08:59 GMT 2013
$ uname -mprsv
SunOS 5.8 Generic_108529-13 i86pc i386
diff --git a/source/1.0/test_results/1.0.4/Solaris-9u8.txt b/source/1.0/test_results/1.0.4/Solaris-9u8.txt
index 9f2877a..2ae38f4 100644
--- a/source/1.0/test_results/1.0.4/Solaris-9u8.txt
+++ b/source/1.0/test_results/1.0.4/Solaris-9u8.txt
@@ -8,7 +8,7 @@ tests=" shflags_test_defines.sh shflags_test_parsing.sh shflags_test_private.sh
# system info
$ date
-Mon Jan 14 23:55:30 GMT 2013
+Tue Jan 15 00:09:36 GMT 2013
$ uname -mprsv
SunOS 5.9 Generic_118559-11 i86pc i386