This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1/3] add test cases for arith


	* testsuite/systemtap.base/arith.stp: add more cases
---
 testsuite/systemtap.base/arith.stp | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/testsuite/systemtap.base/arith.stp b/testsuite/systemtap.base/arith.stp
index 84a8fb0..894ccb8 100644
--- a/testsuite/systemtap.base/arith.stp
+++ b/testsuite/systemtap.base/arith.stp
@@ -29,9 +29,22 @@ probe begin {
   test ("-", -1, 2-3)
   test ("==", 1, -1==-1)
   test ("!=", 1, -1!=1)
+  test (">", 1, 2>1)
+  test (">= (=)", 1, 1>=1)
+  test (">= (>)", 1, 2>=1)
+  test ("<", 1, -1<1)
+  test ("<= (=)", 1, 1<=1)
+  test ("<= (<)", 1, -1<=1)
+
   test ("== s", 1, "foobar"=="foobar")
-  test ("<= s", 1, "fooban"<="foobar")
+  test (">= s (=)", 1, "foobar">="foobar")
+  test ("<= s (=)", 1, "foobar"<="foobar")
+  test ("<= s (<)", 1, "fooban"<="foobar")
+  test (">= s (>)", 1, "xxx">="aaa")
   test ("> s", 1, "xxx">"aaa")
+  test ("< s", 1, "aaa"<"xxx")
+  test ("!= s", 1, "aaa"!="xxx")
+
   test ("<", 1, -1<0)
   test ("<", 1, 85723838<8273823892)
   test ("*", 100300400500, 1003004005 * 100)
@@ -65,8 +78,22 @@ probe begin {
   i=1; test ("i--", i--, 1)
   i=1; test ("i++", i++, 1)
   i=1; test ("+=", i+=4, 5) test ("after +=", i, 5)
+  i=2; test ("*=", i-=1, 1) test ("after -=", i, 1)
   i=5; test ("/=", i/=2, 2) test ("after /=", i, 2)
+  i=2; test ("*=", i*=2, 4) test ("after *=", i, 4)
+  i=3; test ("*=", i%=2, 1) test ("after %=", i, 1)
+  i=0xf; test (">>=", i>>=1, 7) test ("after >>=", i, 7)
+  i=0xf; test ("<<=", i<<=1, 30) test ("after <<=", i, 30)
+  i=0xf; test ("&=", i&=1, 1) test ("after &=", i, 1)
+  i=0xf; test ("^=", i^=1, 14) test ("after ^=", i, 14)
+  i=0xf; test ("|=", i|=1, 15) test ("after |=", i, 15)
+  i=+5; test ("+", i+5, 10)
+  i=-5; test ("+", i+5, 0)
+  i=5; test ("!", !i, 0)
+  i=0xf; test ("~", ~i, -16)
   a="1" b="2"; stest (".=", a .= b, "12") stest ("after .=", a, "12")
+
+  test ("?:", 5==5?1:2, 1)
 }
 
 
-- 
1.8.3.1




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]