Blender
V3.3
|
#include "testing/testing.h"
#include <algorithm>
#include <random>
#include <vector>
#include "BLI_edgehash.h"
#include "BLI_utildefines.h"
Go to the source code of this file.
Classes | |
struct | Edge |
Macros | |
#define | VALUE_1 POINTER_FROM_INT(1) |
#define | VALUE_2 POINTER_FROM_INT(2) |
#define | VALUE_3 POINTER_FROM_INT(3) |
Functions | |
TEST (edgehash, InsertIncreasesLength) | |
TEST (edgehash, ReinsertNewIncreasesLength) | |
TEST (edgehash, ReinsertExistingDoesNotIncreaseLength) | |
TEST (edgehash, ReinsertCanChangeValue) | |
TEST (edgehash, LookupExisting) | |
TEST (edgehash, LookupNonExisting) | |
TEST (edgehash, LookupNonExistingWithDefault) | |
TEST (edgehash, LookupExistingWithDefault) | |
TEST (edgehash, LookupPExisting) | |
TEST (edgehash, LookupPNonExisting) | |
TEST (edgehash, EnsurePNonExisting) | |
TEST (edgehash, EnsurePExisting) | |
TEST (edgehash, RemoveExistingDecreasesLength) | |
TEST (edgehash, RemoveNonExistingDoesNotDecreaseLength) | |
TEST (edgehash, PopKeyTwice) | |
TEST (edgehash, LookupInvertedIndices) | |
TEST (edgehash, HasKeyExisting) | |
TEST (edgehash, HasKeyNonExisting) | |
TEST (edgehash, ClearSetsLengthToZero) | |
TEST (edgehash, IteratorFindsAllValues) | |
TEST (edgehash, IterateIsDone) | |
TEST (edgehash, DoubleRemove) | |
TEST (edgehash, StressTest) | |
TEST (edgeset, AddNonExistingIncreasesLength) | |
TEST (edgeset, AddExistingDoesNotIncreaseLength) | |
TEST (edgeset, HasKeyNonExisting) | |
TEST (edgeset, HasKeyExisting) | |
#define VALUE_1 POINTER_FROM_INT(1) |
Definition at line 11 of file BLI_edgehash_test.cc.
#define VALUE_2 POINTER_FROM_INT(2) |
Definition at line 12 of file BLI_edgehash_test.cc.
#define VALUE_3 POINTER_FROM_INT(3) |
Definition at line 13 of file BLI_edgehash_test.cc.
TEST | ( | edgehash | , |
ClearSetsLengthToZero | |||
) |
Definition at line 223 of file BLI_edgehash_test.cc.
References BLI_edgehash_clear(), BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_len(), BLI_edgehash_new(), VALUE_1, and VALUE_2.
TEST | ( | edgehash | , |
DoubleRemove | |||
) |
Definition at line 284 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_len(), BLI_edgehash_new(), BLI_edgehash_remove(), VALUE_1, VALUE_2, and VALUE_3.
TEST | ( | edgehash | , |
EnsurePExisting | |||
) |
Definition at line 141 of file BLI_edgehash_test.cc.
References BLI_edgehash_ensure_p(), BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_lookup(), BLI_edgehash_new(), VALUE_1, and VALUE_2.
TEST | ( | edgehash | , |
EnsurePNonExisting | |||
) |
Definition at line 128 of file BLI_edgehash_test.cc.
References BLI_edgehash_ensure_p(), BLI_edgehash_free(), BLI_edgehash_lookup(), BLI_edgehash_new(), and VALUE_1.
TEST | ( | edgehash | , |
HasKeyExisting | |||
) |
Definition at line 203 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_haskey(), BLI_edgehash_insert(), BLI_edgehash_new(), and VALUE_1.
TEST | ( | edgehash | , |
HasKeyNonExisting | |||
) |
Definition at line 214 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_haskey(), and BLI_edgehash_new().
TEST | ( | edgehash | , |
InsertIncreasesLength | |||
) |
Definition at line 15 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_len(), BLI_edgehash_new(), and VALUE_1.
TEST | ( | edgehash | , |
IterateIsDone | |||
) |
Definition at line 263 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_new(), BLI_edgehashIterator_free(), BLI_edgehashIterator_isDone(), BLI_edgehashIterator_new(), BLI_edgehashIterator_step(), VALUE_1, VALUE_2, and VALUE_3.
TEST | ( | edgehash | , |
IteratorFindsAllValues | |||
) |
Definition at line 236 of file BLI_edgehash_test.cc.
References Freestyle::a, usdtokens::b(), BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_new(), BLI_edgehashIterator_free(), BLI_edgehashIterator_getValue(), BLI_edgehashIterator_new(), BLI_edgehashIterator_step(), Freestyle::c, ELEM, VALUE_1, VALUE_2, and VALUE_3.
TEST | ( | edgehash | , |
LookupExisting | |||
) |
Definition at line 66 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_lookup(), BLI_edgehash_new(), and VALUE_1.
TEST | ( | edgehash | , |
LookupExistingWithDefault | |||
) |
Definition at line 95 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_lookup_default(), BLI_edgehash_new(), VALUE_1, and VALUE_2.
TEST | ( | edgehash | , |
LookupInvertedIndices | |||
) |
Definition at line 193 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_lookup(), BLI_edgehash_new(), and VALUE_1.
TEST | ( | edgehash | , |
LookupNonExisting | |||
) |
Definition at line 77 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_lookup(), and BLI_edgehash_new().
TEST | ( | edgehash | , |
LookupNonExistingWithDefault | |||
) |
Definition at line 86 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_lookup_default(), BLI_edgehash_new(), and VALUE_1.
TEST | ( | edgehash | , |
LookupPExisting | |||
) |
Definition at line 105 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_lookup(), BLI_edgehash_lookup_p(), BLI_edgehash_new(), VALUE_1, and VALUE_2.
TEST | ( | edgehash | , |
LookupPNonExisting | |||
) |
Definition at line 119 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_lookup_p(), and BLI_edgehash_new().
TEST | ( | edgehash | , |
PopKeyTwice | |||
) |
Definition at line 182 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_new(), BLI_edgehash_popkey(), and VALUE_1.
TEST | ( | edgehash | , |
ReinsertCanChangeValue | |||
) |
Definition at line 52 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_lookup(), BLI_edgehash_new(), BLI_edgehash_reinsert(), VALUE_1, VALUE_2, and VALUE_3.
TEST | ( | edgehash | , |
ReinsertExistingDoesNotIncreaseLength | |||
) |
Definition at line 37 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_len(), BLI_edgehash_new(), BLI_edgehash_reinsert(), VALUE_1, and VALUE_2.
TEST | ( | edgehash | , |
ReinsertNewIncreasesLength | |||
) |
Definition at line 26 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_len(), BLI_edgehash_new(), BLI_edgehash_reinsert(), and VALUE_1.
TEST | ( | edgehash | , |
RemoveExistingDecreasesLength | |||
) |
Definition at line 156 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_len(), BLI_edgehash_new(), BLI_edgehash_remove(), and VALUE_1.
TEST | ( | edgehash | , |
RemoveNonExistingDoesNotDecreaseLength | |||
) |
Definition at line 169 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_len(), BLI_edgehash_new(), BLI_edgehash_remove(), and VALUE_1.
TEST | ( | edgehash | , |
StressTest | |||
) |
Definition at line 304 of file BLI_edgehash_test.cc.
References BLI_edgehash_free(), BLI_edgehash_haskey(), BLI_edgehash_insert(), BLI_edgehash_len(), BLI_edgehash_new(), BLI_edgehash_popkey(), BLI_edgehash_reinsert(), BLI_edgehash_remove(), POINTER_AS_INT, POINTER_FROM_INT, shuffle(), v1, and v2.
TEST | ( | edgeset | , |
AddExistingDoesNotIncreaseLength | |||
) |
Definition at line 376 of file BLI_edgehash_test.cc.
References BLI_edgeset_add(), BLI_edgeset_free(), BLI_edgeset_len(), and BLI_edgeset_new().
TEST | ( | edgeset | , |
AddNonExistingIncreasesLength | |||
) |
Definition at line 361 of file BLI_edgehash_test.cc.
References BLI_edgeset_add(), BLI_edgeset_free(), BLI_edgeset_len(), and BLI_edgeset_new().
TEST | ( | edgeset | , |
HasKeyExisting | |||
) |
Definition at line 400 of file BLI_edgehash_test.cc.
References BLI_edgeset_free(), BLI_edgeset_haskey(), BLI_edgeset_insert(), and BLI_edgeset_new().
TEST | ( | edgeset | , |
HasKeyNonExisting | |||
) |
Definition at line 391 of file BLI_edgehash_test.cc.
References BLI_edgeset_free(), BLI_edgeset_haskey(), and BLI_edgeset_new().