Skip to content

Commit

Permalink
test copy and assignement for properties
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Oct 4, 2024
1 parent e3bd371 commit 40f4832
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion Point_set_3/test/Point_set_3/point_set_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ void test (bool expr, const char* msg)
++ nb_success;
}

bool copy_and_assignement()
{
Point_set ps1;
ps1.add_property_map("prop", int(3));
ps1.add_normal_map();
Point_set ps2 = ps1;
if (!ps2.has_property_map<int>("prop")) return false;
if (!ps2.has_normal_map()) return false;
Point_set ps3(ps1);
if (!ps3.has_property_map<int>("prop")) return false;
if (!ps3.has_normal_map()) return false;
ps1=Point_set();
Point_set ps4 = ps1;
if (ps4.has_property_map<int>("prop")) return false;
if (ps4.has_normal_map()) return false;
Point_set ps5(ps1);
if (ps5.has_property_map<int>("prop")) return false;
if (ps5.has_normal_map()) return false;
return true;
}

int main (int, char**)
{
Expand Down Expand Up @@ -130,7 +150,9 @@ int main (int, char**)
std::unordered_set<Point_set::Index> std_hash;
boost::unordered_set<Point_set::Index> boost_hash;

test(copy_and_assignement(), "copy and assignement");

std::cerr << nb_success << "/" << nb_test << " test(s) succeeded." << std::endl;

return EXIT_SUCCESS;
return nb_success==nb_test ? EXIT_SUCCESS : EXIT_FAILURE;
}

0 comments on commit 40f4832

Please sign in to comment.