From 9bb7d6ed68ef1aa0e6acc3e70901cb6b79c682d2 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Tue, 9 Jun 2020 10:27:24 +0200 Subject: BLI: put C++ data structures in "blender" namespace instead of "BLI" We plan to use the "blender" namespace in other modules as well. --- tests/gtests/blenlib/BLI_map_test.cc | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'tests/gtests/blenlib/BLI_map_test.cc') diff --git a/tests/gtests/blenlib/BLI_map_test.cc b/tests/gtests/blenlib/BLI_map_test.cc index 990683dcfc5..ec4cbb9e53e 100644 --- a/tests/gtests/blenlib/BLI_map_test.cc +++ b/tests/gtests/blenlib/BLI_map_test.cc @@ -6,7 +6,7 @@ #include "BLI_vector.hh" #include "testing/testing.h" -using namespace BLI; +using namespace blender; TEST(map, DefaultConstructor) { @@ -103,7 +103,7 @@ TEST(map, ValueIterator) map.add(1, 2.0f); map.add(7, -2.0f); - BLI::Set values; + blender::Set values; uint iterations = 0; for (float value : map.values()) { @@ -124,7 +124,7 @@ TEST(map, KeyIterator) map.add(2, 4.0f); map.add(1, 3.0f); - BLI::Set keys; + blender::Set keys; uint iterations = 0; for (int key : map.keys()) { @@ -145,8 +145,8 @@ TEST(map, ItemIterator) map.add(2, 9.0f); map.add(1, 0.0f); - BLI::Set keys; - BLI::Set values; + blender::Set keys; + blender::Set values; uint iterations = 0; for (auto item : map.items()) { @@ -423,63 +423,63 @@ BLI_NOINLINE void benchmark_random_ints(StringRef name, uint amount, uint factor TEST(map, Benchmark) { for (uint i = 0; i < 3; i++) { - benchmark_random_ints>("BLI::Map ", 1000000, 1); - benchmark_random_ints>("std::unordered_map", 1000000, 1); + benchmark_random_ints>("blender::Map ", 1000000, 1); + benchmark_random_ints>("std::unordered_map", 1000000, 1); } std::cout << "\n"; for (uint i = 0; i < 3; i++) { uint32_t factor = (3 << 10); - benchmark_random_ints>("BLI::Map ", 1000000, factor); - benchmark_random_ints>( + benchmark_random_ints>("blender::Map ", 1000000, factor); + benchmark_random_ints>( "std::unordered_map", 1000000, factor); } } /** - * Timer 'BLI::Map Add' took 61.7616 ms - * Timer 'BLI::Map Contains' took 18.4989 ms - * Timer 'BLI::Map Remove' took 20.5864 ms + * Timer 'blender::Map Add' took 61.7616 ms + * Timer 'blender::Map Contains' took 18.4989 ms + * Timer 'blender::Map Remove' took 20.5864 ms * Count: 1999755 * Timer 'std::unordered_map Add' took 188.674 ms * Timer 'std::unordered_map Contains' took 44.3741 ms * Timer 'std::unordered_map Remove' took 169.52 ms * Count: 1999755 - * Timer 'BLI::Map Add' took 37.9196 ms - * Timer 'BLI::Map Contains' took 16.7361 ms - * Timer 'BLI::Map Remove' took 20.9568 ms + * Timer 'blender::Map Add' took 37.9196 ms + * Timer 'blender::Map Contains' took 16.7361 ms + * Timer 'blender::Map Remove' took 20.9568 ms * Count: 1999755 * Timer 'std::unordered_map Add' took 166.09 ms * Timer 'std::unordered_map Contains' took 40.6133 ms * Timer 'std::unordered_map Remove' took 142.85 ms * Count: 1999755 - * Timer 'BLI::Map Add' took 37.3053 ms - * Timer 'BLI::Map Contains' took 16.6731 ms - * Timer 'BLI::Map Remove' took 18.8304 ms + * Timer 'blender::Map Add' took 37.3053 ms + * Timer 'blender::Map Contains' took 16.6731 ms + * Timer 'blender::Map Remove' took 18.8304 ms * Count: 1999755 * Timer 'std::unordered_map Add' took 170.964 ms * Timer 'std::unordered_map Contains' took 38.1824 ms * Timer 'std::unordered_map Remove' took 140.263 ms * Count: 1999755 * - * Timer 'BLI::Map Add' took 50.1131 ms - * Timer 'BLI::Map Contains' took 25.0491 ms - * Timer 'BLI::Map Remove' took 32.4225 ms + * Timer 'blender::Map Add' took 50.1131 ms + * Timer 'blender::Map Contains' took 25.0491 ms + * Timer 'blender::Map Remove' took 32.4225 ms * Count: 1889920 * Timer 'std::unordered_map Add' took 150.129 ms * Timer 'std::unordered_map Contains' took 34.6999 ms * Timer 'std::unordered_map Remove' took 120.907 ms * Count: 1889920 - * Timer 'BLI::Map Add' took 50.4438 ms - * Timer 'BLI::Map Contains' took 25.2677 ms - * Timer 'BLI::Map Remove' took 32.3047 ms + * Timer 'blender::Map Add' took 50.4438 ms + * Timer 'blender::Map Contains' took 25.2677 ms + * Timer 'blender::Map Remove' took 32.3047 ms * Count: 1889920 * Timer 'std::unordered_map Add' took 144.015 ms * Timer 'std::unordered_map Contains' took 36.3387 ms * Timer 'std::unordered_map Remove' took 119.109 ms * Count: 1889920 - * Timer 'BLI::Map Add' took 48.6995 ms - * Timer 'BLI::Map Contains' took 25.1846 ms - * Timer 'BLI::Map Remove' took 33.0283 ms + * Timer 'blender::Map Add' took 48.6995 ms + * Timer 'blender::Map Contains' took 25.1846 ms + * Timer 'blender::Map Remove' took 33.0283 ms * Count: 1889920 * Timer 'std::unordered_map Add' took 143.494 ms * Timer 'std::unordered_map Contains' took 34.8905 ms -- cgit v1.2.3