From 9e5cee2444c526d820891aba9e09e66e6b2c888e Mon Sep 17 00:00:00 2001 From: jrm Date: Wed, 12 Aug 2015 09:42:50 -0700 Subject: [PATCH] [infer][eradicate] Fix eradicate tests for field not initialized Summary: This test was actually testing: "at least one Field not initialized error is found" where we actualy want to test "exactly one Field not initialized error is found". The case of @Inject was also missing from the tests. --- dependencies/java/jsr-330/BUCK | 7 +++++++ dependencies/java/jsr-330/javax.inject.jar | Bin 0 -> 4285 bytes infer/tests/codetoanalyze/java/eradicate/BUCK | 1 + .../java/eradicate/FieldNotInitialized.java | 18 +++++++++++------- .../eradicate/FieldNotInitializedTest.java | 10 ++++------ 5 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 dependencies/java/jsr-330/BUCK create mode 100644 dependencies/java/jsr-330/javax.inject.jar diff --git a/dependencies/java/jsr-330/BUCK b/dependencies/java/jsr-330/BUCK new file mode 100644 index 000000000..a0e3d0b2b --- /dev/null +++ b/dependencies/java/jsr-330/BUCK @@ -0,0 +1,7 @@ +prebuilt_jar( + name = 'jsr-330', + binary_jar = 'javax.inject.jar', + visibility = [ + 'PUBLIC', + ], +) diff --git a/dependencies/java/jsr-330/javax.inject.jar b/dependencies/java/jsr-330/javax.inject.jar new file mode 100644 index 0000000000000000000000000000000000000000..39e92a1a05a54b7bd655429ebcfd9fe2fe3532aa GIT binary patch literal 4285 zcmb7H2{@G78=nkg$k@pUsc2EgmLyj-lw!=pjI9z)jD495bLA#cGZICTts!OK6S5|R zYwR+`wM4Q@Dbkhg|4l-s{`WrjJkR;Q^E}`C{=Rd5=Uoj@V0La0bMU2~)%dpf{@?=M z=wn7md0mW-g28t&D2NvjTQX6oZ~;D3fGPZ=7#fMu)j5VULZEe~&<*waD0xIH3?(nu z)XK z2(WU%lkuLbXZTqLwkl)q;y|!+UlmAO*h<%DLXvT&RJ`e%OkYpbuli$6k;^=Jwxs5XzY*QwbtuC8Q0!AU1E-hAn5 zJr`LOPZq4EwZg7Sm9$sGl}_F2+q^Sx5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bvni^SAMJ;4?JALuBGh_%U6ALC>ZTzcc>++wKTOX zQ9m%}X3UlqQ~Ej8^8xg%rg~>Qnc%X@;m^WbeipX!MBv@+5YBiPD}s}v(myE6|GP5Y zU4A(W%j1dmt58r-QrcOKaGS3Rv1}la1{4I^_g|riuFeQgXQyi8u3K%2{N5i-%>?)+ z`8AvcP8+|@klS^>_4QHFs&q9EoN0jMUzjeD{@x4k%xM-T(lWJoR1R6)k5W;oF`e7S zc}7k|XkJtvT!VUZK1*PbV>woSJ4U}iqT7Aj(m zQkRic>N2S1(d_PhSfJ=9aKOJKJyC@!%Gu}x;@O&Y`7PrddxLGOigx-`#{`+EmfxW( ze6#gS*S#ubUbt!WWEdpJqncv&V*XyB<`diV`yQ#A>BC&w7JvF+QO$%OA zo#;}^D?};);s1{(_8-DqYW;Qw>2xeYBfqiT9D}5z%D8&OL$2EY4Y+ zl-2LnyAIRdiEcnnaC5gOkYMy2?n*^|P|HGDe;i3mP@+?dQ^1fjvt_%3do^@n?n(Ietwm6EE-=9g!mw7>80 z@*KDji}4mRK`W1_C6+5#`97}F;F#SMaATB?6h;eNHb8A)69)hP1_L+~F!(_eNalO> zcx!6EZaA32%#q-`6L_ww{m_1_A^cqKGh2e?!Tj-`z;dNQSlcYK%~_FRzL_n;@?h$W z1IuNd)rMh3_17)KigJRlD3FHMss7kNtnK>OMe`cW86XO-gZZI^W<_BwA=gmufLT!1 z7nH0(thL)3kQF-%5KAS;io{yTtRcm5ups?V*07?mruH=y25`sg=wV6pYe+vQIA%6n z9^bB-^9KW4$&D+Q{j)MNJFY2<0eNcGI+vAMefFPr!pxRyV8;Irwmtx?LH{~?u7D@_ w#{F05@458HKQKLpHD0a#A!OsfGO>R1>!X(eisPHt@`3n3CjeWs", - }; assertThat( "Results should contain " + FIELD_NOT_INITIALIZED, inferResults, - containsExactly( + containsNumberOfErrors( FIELD_NOT_INITIALIZED, SOURCE_FILE, - methods)); + "", + 1)); } }