Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F77571446
test_str.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Aug 15, 06:14
Size
751 B
Mime Type
text/x-c
Expires
Sat, Aug 17, 06:14 (2 d)
Engine
blob
Format
Raw Data
Handle
19866167
Attached To
rAKA akantu
test_str.cc
View Options
/* -------------------------------------------------------------------------- */
#include "aka_str_hash.hh"
#include "aka_tuple_tools.hh"
/* -------------------------------------------------------------------------- */
#include <gtest/gtest.h>
/* -------------------------------------------------------------------------- */
using namespace aka;
using namespace aka::hash;
TEST(STRHash, CRC32) {
auto crc = "stack-overflow"_crc32;
EXPECT_EQ(crc, 0x335CC04A);
}
TEST(STRHash, fnv1a32) {
auto hash = "cyclist"_fnv1a32;
EXPECT_EQ(hash, 0xc441a122);
}
TEST(STRHash, fnv1a64) {
auto hash = "cyclist"_fnv1a64;
EXPECT_EQ(hash, 0x4e376afdf5d98282);
}
TEST(STRHash, Litteral) {
auto h = "cyclist"_h;
EXPECT_EQ(h, 0x4e376afdf5d98282);
}
Event Timeline
Log In to Comment