Skip to contentSkip to conversation

: fix memcg_function_test's bug

PATCH In review liubo 3 participants 4 messages Oct 9, 2009 – Oct 13, 2009

lore
Share & tools
lore

liubo

author
#0 lore raw

PATCH 1/1 : fix memcg_function_test's bug

testcase_25() uses a wrong "$?" value ,
Now use "ret" to record the real "$?"
value for test .

---

testcases/kernel/controllers/memcg/functional/memcg_function_test.sh +3 -2
index ea4c8a2..0f11835 100755
@@ -398,11 +398,12 @@ testcase_24()
 testcase_25()
 {
 	echo -1 > memory.limit_in_bytes 2> /dev/null
+	ret=$?
 	tst_kvercmp 2 6 31
 	if [ $? -eq 0 ]; then
-		result $(( !($? != 0) ))  "return value is $?"
+		result $(( !($ret != 0) ))  "return value is $ret"
        else
-		result $(( !($? == 0) ))  "return value is $?"
+		result $(( !($ret == 0) ))  "return value is $ret"
 	fi
 }
 

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw
Quoted 18 lines · liubo

testcase_25() uses a wrong "$?" value ,
Now use "ret" to record the real "$?"
value for test .

---

testcases/kernel/controllers/memcg/functional/memcg_function_test.sh +0 -0
index ea4c8a2..0f11835 100755
@@ -398,11 +398,12 @@ testcase_24()
  testcase_25()
  {

       echo -1 > memory.limit_in_bytes 2> /dev/null
+       ret=$?
       tst_kvercmp 2 6 31

Quoted 8 lines

       if [ $? -eq 0 ]; then
-               result $(( !($? != 0) ))  "return value is $?"
+               result $(( !($ret != 0) ))  "return value is $ret" else
-               result $(( !($? == 0) ))  "return value is $?"
+               result $(( !($ret == 0) ))  "return value is $ret" fi
 }

Good catch ;)...

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
In reply to liubo
Quoted 6 lines · liubo

testcase_25() uses a wrong "$?" value ,
Now use "ret" to record the real "$?"
value for test .

Thanks.

Regards--
Subrata

Quoted 24 lines

---

testcases/kernel/controllers/memcg/functional/memcg_function_test.sh +3 -3
index ea4c8a2..0f11835 100755
@@ -398,11 +398,12 @@ testcase_24()
 testcase_25()
 {
 	echo -1 > memory.limit_in_bytes 2> /dev/null
+	ret=$?
 	tst_kvercmp 2 6 31
 	if [ $? -eq 0 ]; then
-		result $(( !($? != 0) ))  "return value is $?"
+		result $(( !($ret != 0) ))  "return value is $ret"
        else
-		result $(( !($? == 0) ))  "return value is $?"
+		result $(( !($ret == 0) ))  "return value is $ret"
 	fi
 }
 
 
------------------------------------------------------------------------------

Come build with us! The BlackBerry(R) Developer Conference in SF, CA

Quoted 8 lines

is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw
In reply to liubo
Quoted 6 lines · liubo

testcase_25() uses a wrong "$?" value ,
Now use "ret" to record the real "$?"
value for test .

Thanks.

Regards--
Subrata

Quoted 24 lines

---

testcases/kernel/controllers/memcg/functional/memcg_function_test.sh +3 -3
index ea4c8a2..0f11835 100755
@@ -398,11 +398,12 @@ testcase_24()
 testcase_25()
 {
 	echo -1 > memory.limit_in_bytes 2> /dev/null
+	ret=$?
 	tst_kvercmp 2 6 31
 	if [ $? -eq 0 ]; then
-		result $(( !($? != 0) ))  "return value is $?"
+		result $(( !($ret != 0) ))  "return value is $ret"
        else
-		result $(( !($? == 0) ))  "return value is $?"
+		result $(( !($ret == 0) ))  "return value is $ret"
 	fi
 }
 
 
------------------------------------------------------------------------------

Come build with us! The BlackBerry(R) Developer Conference in SF, CA

Quoted 8 lines

is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list