diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /tests/gtests/blenlib/BLI_hash_mm2a_test.cc | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'tests/gtests/blenlib/BLI_hash_mm2a_test.cc')
-rw-r--r-- | tests/gtests/blenlib/BLI_hash_mm2a_test.cc | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/tests/gtests/blenlib/BLI_hash_mm2a_test.cc b/tests/gtests/blenlib/BLI_hash_mm2a_test.cc index 109c925af4c..16a2db6af56 100644 --- a/tests/gtests/blenlib/BLI_hash_mm2a_test.cc +++ b/tests/gtests/blenlib/BLI_hash_mm2a_test.cc @@ -12,64 +12,64 @@ extern "C" { TEST(hash_mm2a, MM2ABasic) { - BLI_HashMurmur2A mm2; + BLI_HashMurmur2A mm2; - const char *data = "Blender"; + const char *data = "Blender"; - BLI_hash_mm2a_init(&mm2, 0); - BLI_hash_mm2a_add(&mm2, (const unsigned char *)data, strlen(data)); + BLI_hash_mm2a_init(&mm2, 0); + BLI_hash_mm2a_add(&mm2, (const unsigned char *)data, strlen(data)); #ifdef __LITTLE_ENDIAN__ - EXPECT_EQ(BLI_hash_mm2a_end(&mm2), 1633988145); + EXPECT_EQ(BLI_hash_mm2a_end(&mm2), 1633988145); #else - EXPECT_EQ(BLI_hash_mm2a_end(&mm2), 959283772); + EXPECT_EQ(BLI_hash_mm2a_end(&mm2), 959283772); #endif } TEST(hash_mm2a, MM2AConcatenateStrings) { - BLI_HashMurmur2A mm2; - uint32_t hash; + BLI_HashMurmur2A mm2; + uint32_t hash; - const char *data1 = "Blender"; - const char *data2 = " is "; - const char *data3 = "FaNtAsTiC"; - const char *data123 = "Blender is FaNtAsTiC"; + const char *data1 = "Blender"; + const char *data2 = " is "; + const char *data3 = "FaNtAsTiC"; + const char *data123 = "Blender is FaNtAsTiC"; - BLI_hash_mm2a_init(&mm2, 0); - BLI_hash_mm2a_add(&mm2, (const unsigned char *)data1, strlen(data1)); - BLI_hash_mm2a_add(&mm2, (const unsigned char *)data2, strlen(data2)); - BLI_hash_mm2a_add(&mm2, (const unsigned char *)data3, strlen(data3)); - hash = BLI_hash_mm2a_end(&mm2); - BLI_hash_mm2a_init(&mm2, 0); - BLI_hash_mm2a_add(&mm2, (const unsigned char *)data123, strlen(data123)); + BLI_hash_mm2a_init(&mm2, 0); + BLI_hash_mm2a_add(&mm2, (const unsigned char *)data1, strlen(data1)); + BLI_hash_mm2a_add(&mm2, (const unsigned char *)data2, strlen(data2)); + BLI_hash_mm2a_add(&mm2, (const unsigned char *)data3, strlen(data3)); + hash = BLI_hash_mm2a_end(&mm2); + BLI_hash_mm2a_init(&mm2, 0); + BLI_hash_mm2a_add(&mm2, (const unsigned char *)data123, strlen(data123)); #ifdef __LITTLE_ENDIAN__ - EXPECT_EQ(hash, 1545105348); + EXPECT_EQ(hash, 1545105348); #else - EXPECT_EQ(hash, 2604964730); + EXPECT_EQ(hash, 2604964730); #endif - EXPECT_EQ(BLI_hash_mm2a_end(&mm2), hash); + EXPECT_EQ(BLI_hash_mm2a_end(&mm2), hash); } TEST(hash_mm2a, MM2AIntegers) { - BLI_HashMurmur2A mm2; - uint32_t hash; + BLI_HashMurmur2A mm2; + uint32_t hash; - const int ints[4] = {1, 2, 3, 4}; + const int ints[4] = {1, 2, 3, 4}; - BLI_hash_mm2a_init(&mm2, 0); - BLI_hash_mm2a_add_int(&mm2, ints[0]); - BLI_hash_mm2a_add_int(&mm2, ints[1]); - BLI_hash_mm2a_add_int(&mm2, ints[2]); - BLI_hash_mm2a_add_int(&mm2, ints[3]); - hash = BLI_hash_mm2a_end(&mm2); - BLI_hash_mm2a_init(&mm2, 0); - BLI_hash_mm2a_add(&mm2, (const unsigned char *)ints, sizeof(ints)); - /* Yes, same hash here on little and big endian. */ + BLI_hash_mm2a_init(&mm2, 0); + BLI_hash_mm2a_add_int(&mm2, ints[0]); + BLI_hash_mm2a_add_int(&mm2, ints[1]); + BLI_hash_mm2a_add_int(&mm2, ints[2]); + BLI_hash_mm2a_add_int(&mm2, ints[3]); + hash = BLI_hash_mm2a_end(&mm2); + BLI_hash_mm2a_init(&mm2, 0); + BLI_hash_mm2a_add(&mm2, (const unsigned char *)ints, sizeof(ints)); + /* Yes, same hash here on little and big endian. */ #ifdef __LITTLE_ENDIAN__ - EXPECT_EQ(hash, 405493096); + EXPECT_EQ(hash, 405493096); #else - EXPECT_EQ(hash, 405493096); + EXPECT_EQ(hash, 405493096); #endif - EXPECT_EQ(BLI_hash_mm2a_end(&mm2), hash); + EXPECT_EQ(BLI_hash_mm2a_end(&mm2), hash); } |