Skip to content

Commit d934040

Browse files
dulmarodfacebook-github-bot
authored andcommitted
[tests] [5/n] Adapt and copy to Pulse a test about the implementation of ObjC method names
Summary: This is a test of the frontend; that we handle the instance and class names correctly. Reviewed By: skcho Differential Revision: D32431910 fbshipit-source-id: 72dba72ba
1 parent 6dd1555 commit d934040

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

infer/tests/codetoanalyze/objc/biabduction/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ INFERPRINT_OPTIONS = --issues-tests
1515
SOURCES_DEFAULT = \
1616
memory_leaks_benchmark/NSString_models_tests.m \
1717
npe/dynamic_dispatch.m \
18-
npe/Npe_with_equal_names.m \
1918
npe/block.m \
2019
npe/ivar_blocks.m \
2120
npe/skip_method_with_nil_object.m \

infer/tests/codetoanalyze/objc/biabduction/issues.exp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ codetoanalyze/objc/biabduction/subtyping/KindOfClassExample.m, shouldThrowDivide
8383
codetoanalyze/objc/biabduction/subtyping/KindOfClassExample.m, shouldThrowDivideByZero3, 3, DIVIDE_BY_ZERO, no_bucket, ERROR, [start of procedure shouldThrowDivideByZero3(),start of procedure init,return from a call to Derived.init,Taking true branch]
8484
codetoanalyze/objc/biabduction/variadic_methods/premature_nil_termination.m, PrematureNilTermA.nilInArrayWithObjects, 5, PREMATURE_NIL_TERMINATION_ARGUMENT, B1, WARNING, [start of procedure nilInArrayWithObjects]
8585
codetoanalyze/objc/biabduction/memory_leaks_benchmark/NSString_models_tests.m, StringInitA.hexStringValue, 11, BIABDUCTION_MEMORY_LEAK, no_bucket, ERROR, [start of procedure hexStringValue,Skipping CFStringCreateWithBytesNoCopy(): method has no implementation,Taking false branch]
86-
codetoanalyze/objc/biabduction/npe/Npe_with_equal_names.m, EqualNamesTest, 3, NULL_DEREFERENCE, B1, ERROR, [start of procedure EqualNamesTest(),start of procedure meth,return from a call to EqualNamesA.meth]
8786
codetoanalyze/objc/biabduction/npe/Nsstring_nil_args.m, initWithFormatBad, 3, NULL_DEREFERENCE, B1, ERROR, [start of procedure initWithFormatBad()]
8887
codetoanalyze/objc/biabduction/npe/Nsstring_nil_args.m, stringByAppendingStringBad, 2, NULL_DEREFERENCE, B1, ERROR, [start of procedure stringByAppendingStringBad()]
8988
codetoanalyze/objc/biabduction/npe/Nsstring_nil_args.m, stringWithStringBad, 2, NULL_DEREFERENCE, B1, ERROR, [start of procedure stringWithStringBad(),start of procedure nullableMethod(),return from a call to nullableMethod]

infer/tests/codetoanalyze/objc/pulse/issues.exp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ codetoanalyze/objc/pulse/memory_leaks/MemoryLeaks.m, call_bridge_interproc_leak_
88
codetoanalyze/objc/pulse/memory_leaks/MemoryLeaks.m, call_cfrelease_interproc_leak_ok_FP, 2, MEMORY_LEAK, no_bucket, ERROR, [allocation part of the trace starts here,allocated by `CFLocaleCreate (custom malloc)` here,memory becomes unreachable here]
99
codetoanalyze/objc/pulse/memory_leaks/MemoryLeaksInBlocks.m, block_captured_var_leak_bad, 6, MEMORY_LEAK, no_bucket, ERROR, [allocation part of the trace starts here,allocated by `malloc` here,memory becomes unreachable here]
1010
codetoanalyze/objc/pulse/memory_leaks/MemoryLeaksInBlocks.m, objc_blockblock_free_ok_npe_latent_FP_2, 1, NULLPTR_DEREFERENCE_LATENT, no_bucket, ERROR, [source of the null value part of the trace starts here,is the null pointer,null pointer dereference part of the trace starts here,parameter `x` of objc_blockblock_free_ok_npe_latent_FP_2,invalid access occurs here]
11+
codetoanalyze/objc/pulse/null_deref/FrontendEqualNames.m, EqualNamesInstanceNPEBad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `EqualNamesA.meth`,is the null pointer,returned,return from call to `EqualNamesA.meth`,assigned,invalid access occurs here]
1112
codetoanalyze/objc/pulse/null_deref/IvarsInheritanceNPE.m, fields_set_up_correctly_npe_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [is the null pointer,assigned,invalid access occurs here]
1213
codetoanalyze/objc/pulse/null_deref/NPEBlocks.m, Singleton.dispatch_once_captured_vars_bad, 8, NULLPTR_DEREFERENCE, no_bucket, ERROR, [is the null pointer,assigned,in call to `objc_blockSingleton.dispatch_once_captured_vars_bad_2`,parameter `x` of objc_blockSingleton.dispatch_once_captured_vars_bad_2,assigned,return from call to `objc_blockSingleton.dispatch_once_captured_vars_bad_2`,invalid access occurs here]
1314
codetoanalyze/objc/pulse/null_deref/NPEBlocks.m, captured_npe_bad, 5, NULLPTR_DEREFERENCE, no_bucket, ERROR, [is the null pointer,assigned,when calling `objc_blockcaptured_npe_bad_4` here,parameter `x` of objc_blockcaptured_npe_bad_4,invalid access occurs here]

infer/tests/codetoanalyze/objc/biabduction/npe/Npe_with_equal_names.m renamed to infer/tests/codetoanalyze/objc/pulse/null_deref/FrontendEqualNames.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ - (EqualNamesA*)meth {
3030

3131
@end
3232

33-
int EqualNamesTest() {
33+
int EqualNamesInstanceNPEBad() {
3434
EqualNamesA* para = [EqualNamesA new];
3535
EqualNamesA* a = [para meth];
3636
return a->x;
3737
}
3838

39-
int EqualNamesTest2(EqualNamesA* para) {
39+
int EqualNamesClassNoNPEGood(EqualNamesA* para) {
4040
EqualNamesA* a = [EqualNamesA meth];
4141
return a->x;
4242
}

0 commit comments

Comments
 (0)