Thread: [Fb-contrib-commit] SF.net SVN: fb-contrib: [886] trunk/fb-contrib/samples/UAA_Sample.java
Brought to you by:
dbrosius
From: <dbr...@us...> - 2007-06-24 22:23:03
|
Revision: 886 http://svn.sourceforge.net/fb-contrib/?rev=886&view=rev Author: dbrosius Date: 2007-06-24 15:23:02 -0700 (Sun, 24 Jun 2007) Log Message: ----------- add some initial test cases for UAA Added Paths: ----------- trunk/fb-contrib/samples/UAA_Sample.java Added: trunk/fb-contrib/samples/UAA_Sample.java =================================================================== --- trunk/fb-contrib/samples/UAA_Sample.java (rev 0) +++ trunk/fb-contrib/samples/UAA_Sample.java 2007-06-24 22:23:02 UTC (rev 886) @@ -0,0 +1,54 @@ +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + + +public class UAA_Sample { + + private Set<String> in = new HashSet<String>(); + private Set<String> out = new HashSet<String>(); + + public Set<String> testLocalSet(Set<String> in) { + Set<String> out = new HashSet<String>(); + out.add("Foo"); + out.add("Bar"); + for (String s : in) { + out.add(s); + } + return out; + } + + public Set<String> testFPCondition(Set<String> in) { + Set<String> out = new HashSet<String>(); + for (String s : in) { + if (s.startsWith("a")) + out.add(s); + } + return out; + } + + public Set<String> testKeyOrValueAdd(Map<String, String> in) + { + Set<String> out = new HashSet<String>(); + for (String s : in.keySet()) + out.add(s); + + for (String s : in.values()) + out.add(s); + + return out; + } + + public void testMemberSet() { + for (String s : in) + out.add(s); + } + + public Set<String> testFromArray(String[] in) { + Set<String> out = new HashSet<String>(); + for (String s : in) + out.add(s); + + return out; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2007-10-11 02:45:04
|
Revision: 929 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=929&view=rev Author: dbrosius Date: 2007-10-10 19:45:03 -0700 (Wed, 10 Oct 2007) Log Message: ----------- add fp case Modified Paths: -------------- trunk/fb-contrib/samples/UAA_Sample.java Modified: trunk/fb-contrib/samples/UAA_Sample.java =================================================================== --- trunk/fb-contrib/samples/UAA_Sample.java 2007-10-08 01:42:30 UTC (rev 928) +++ trunk/fb-contrib/samples/UAA_Sample.java 2007-10-11 02:45:03 UTC (rev 929) @@ -1,4 +1,6 @@ import java.util.HashSet; +import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.Set; @@ -51,4 +53,16 @@ return out; } + + public void testFPIfAtEndOfLoop(List<String> d, List<String> s, int i) + { + Iterator<String> it = s.iterator(); + while (it.hasNext()) + { + if (i == 0) + { + d.add(it.next()); + } + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-03-09 03:42:52
|
Revision: 991 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=991&view=rev Author: dbrosius Date: 2008-03-08 19:42:54 -0800 (Sat, 08 Mar 2008) Log Message: ----------- add false positive as described by 1909543 Modified Paths: -------------- trunk/fb-contrib/samples/UAA_Sample.java Modified: trunk/fb-contrib/samples/UAA_Sample.java =================================================================== --- trunk/fb-contrib/samples/UAA_Sample.java 2008-03-09 03:35:10 UTC (rev 990) +++ trunk/fb-contrib/samples/UAA_Sample.java 2008-03-09 03:42:54 UTC (rev 991) @@ -65,4 +65,13 @@ } } } + + public void testAddWithCheck(List<String> src, List<String> dst) + { + for (String s : src) + { + if (dst.add(s)) + System.out.println("Hmm"); + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-03-15 04:59:38
|
Revision: 1004 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1004&view=rev Author: dbrosius Date: 2008-03-14 21:59:43 -0700 (Fri, 14 Mar 2008) Log Message: ----------- test case for [ 1914317 ] FalsePositive UAA_USE_ADD_ALL Modified Paths: -------------- trunk/fb-contrib/samples/UAA_Sample.java Modified: trunk/fb-contrib/samples/UAA_Sample.java =================================================================== --- trunk/fb-contrib/samples/UAA_Sample.java 2008-03-15 04:46:51 UTC (rev 1003) +++ trunk/fb-contrib/samples/UAA_Sample.java 2008-03-15 04:59:43 UTC (rev 1004) @@ -1,3 +1,4 @@ +import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -40,6 +41,19 @@ return out; } + + public void fpPrematureLoopEnd(List<String> ss) + { + for (String s : ss) + { + out.add(s); + if (s.length() == 0) + { + continue; + } + out.add(s); + } + } public void testMemberSet() { for (String s : in) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |