Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90722073
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
Mon, Nov 4, 04:29
Size
751 B
Mime Type
text/x-c
Expires
Wed, Nov 6, 04:29 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22063077
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