Improve empty vector tests

Summary:
Now all code in tests is reachable by the analyzer which increases
test quality.

Reviewed By: dulmarod

Differential Revision: D3358591

fbshipit-source-id: d54877e
master
Andrzej Kotulski 9 years ago committed by Facebook Github Bot 7
parent bf9d194e43
commit 0f895b0684

@ -69,32 +69,28 @@ int assign_nonempty() {
return vec2[0]; return vec2[0];
} }
int empty_check_nonempty() { int empty_check_nonempty(std::vector<int>& vec) {
std::vector<int> vec;
if (vec.empty()) { if (vec.empty()) {
return 1; return 1;
} }
return vec[0]; return vec[0];
} }
int empty_check_nonempty2() { int empty_check_nonempty2(std::vector<int>& vec) {
std::vector<int> vec;
if (vec.empty()) { if (vec.empty()) {
vec.push_back(1); vec.push_back(1);
} }
return vec[0]; return vec[0];
} }
int empty_check_access_empty() { int empty_check_access_empty(std::vector<int>& vec) {
std::vector<int> vec;
if (vec.empty()) { if (vec.empty()) {
return vec[0]; return vec[0];
} }
return 1; return 1;
} }
int size_check0_empty() { int size_check0_empty(std::vector<int>& vec) {
std::vector<int> vec;
if (vec.size() == 0) { if (vec.size() == 0) {
return vec[0]; return vec[0];
} }

Loading…
Cancel
Save