[pulse] fix test for by-ref automatic initialisation

Summary:
Pointers are hard... The previous test had no chance of doing
initialisation of the pointer by reference and was in fact a false
negative (and still is, fix incoming). Renamed functions to stress the
false negative and added a test that is really (potentially) doing
pointer initialisation by reference.

Reviewed By: skcho

Differential Revision: D18888008

fbshipit-source-id: 1e72408c7
master
Jules Villard 5 years ago committed by Facebook Github Bot
parent f4d3513724
commit a42e15147b

@ -24,12 +24,22 @@ void const_no_init_bad_FN() {
p->foo();
}
void unknown_init_value_by_ref(X* x);
void unknown_init_value_by_ref(X** x);
void wrap_unknown_init(X* x) { unknown_init_value_by_ref(x); }
void wrap_unknown_init(X** x) { unknown_init_value_by_ref(x); }
void call_unknown_init_interproc_ok() {
X* p = nullptr;
wrap_unknown_init(p);
wrap_unknown_init(&p);
p->foo();
}
void unknown_with_pointer_formal(X* x);
void wrap_unknown_no_init(X* x) { unknown_with_pointer_formal(x); }
void call_init_with_pointer_value_bad_FN() {
X* p = nullptr;
wrap_unknown_no_init(p);
p->foo();
}

Loading…
Cancel
Save