aboutsummaryrefslogtreecommitdiffstats
path: root/cicn-plugin/cicn/test/test_cicn_hash_cdata.c
diff options
context:
space:
mode:
Diffstat (limited to 'cicn-plugin/cicn/test/test_cicn_hash_cdata.c')
-rw-r--r--cicn-plugin/cicn/test/test_cicn_hash_cdata.c161
1 files changed, 161 insertions, 0 deletions
diff --git a/cicn-plugin/cicn/test/test_cicn_hash_cdata.c b/cicn-plugin/cicn/test/test_cicn_hash_cdata.c
new file mode 100644
index 00000000..ab5e7993
--- /dev/null
+++ b/cicn-plugin/cicn/test/test_cicn_hash_cdata.c
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * test_cicn_hash_cdata.c: UT for hash function: comparison data, claimed good to check calculated data
+ *
+ * - NOTE: Entries in array generated by test_hash_cdata_dump().
+ */
+
+#include "test_cicn_hash.h"
+
+test_cicn_hash_namedata_t hash_namedata_cdata[] = {
+ {.th_name = "/",
+ .th_namebytes = 1,
+ .th_pfx_hi = {
+ .pfx_len = 0,.pfx_count = 0,.pfx_overflow =
+ 0,.pfx_full_hash = 0xf1a89ef060ec5ab2,
+ .pfx_lens = {}
+ ,
+ .pfx_hashes = {}
+ ,}
+ ,
+ }
+ ,
+ {.th_name = "/1",
+ .th_namebytes = 2,
+ .th_pfx_hi = {
+ .pfx_len = 5,.pfx_count = 1,.pfx_overflow =
+ 0,.pfx_full_hash = 0xa21d733c21450fb0,
+ .pfx_lens = {5,}
+ ,
+ .pfx_hashes = {0xa21d733c21450fb0,}
+ ,}
+ ,
+ }
+ ,
+ {.th_name = "/1/2",
+ .th_namebytes = 4,
+ .th_pfx_hi = {
+ .pfx_len = 10,.pfx_count = 2,.pfx_overflow =
+ 0,.pfx_full_hash = 0x2483307ff018e378,
+ .pfx_lens = {5, 10,}
+ ,
+ .pfx_hashes = {0xa21d733c21450fb0, 0x2483307ff018e378,}
+ ,}
+ ,
+ }
+ ,
+ {.th_name = "/1/2/3",
+ .th_namebytes = 6,
+ .th_pfx_hi = {
+ .pfx_len = 15,.pfx_count = 3,.pfx_overflow =
+ 0,.pfx_full_hash = 0x359fc658c64a6901,
+ .pfx_lens = {5, 10, 15,}
+ ,
+ .pfx_hashes =
+ {0xa21d733c21450fb0, 0x2483307ff018e378, 0x359fc658c64a6901,}
+ ,}
+ ,
+ }
+ ,
+ {.th_name = "/1/2/3/4/5/6/7",
+ .th_namebytes = 14,
+ .th_pfx_hi = {
+ .pfx_len = 35,.pfx_count = 7,.pfx_overflow =
+ 0,.pfx_full_hash = 0xb62b3a4a289f1f16,
+ .pfx_lens = {5, 10, 15, 20, 25, 30, 35,}
+ ,
+ .pfx_hashes =
+ {0xa21d733c21450fb0, 0x2483307ff018e378, 0x359fc658c64a6901,
+ 0xe1f52cd7e83b0c01, 0xe883c57a77ccbb45, 0xd3b98a367b166454,
+ 0xb62b3a4a289f1f16,}
+ ,}
+ ,
+ }
+ ,
+ {.th_name = "/1/2/3/4/5/6/7.1",
+ .th_namebytes = 16,
+ .th_pfx_hi = {
+ .pfx_len = 37,.pfx_count = 7,.pfx_overflow =
+ 0,.pfx_full_hash = 0xff30f5f715e86753,
+ .pfx_lens = {5, 10, 15, 20, 25, 30, 37,}
+ ,
+ .pfx_hashes =
+ {0xa21d733c21450fb0, 0x2483307ff018e378, 0x359fc658c64a6901,
+ 0xe1f52cd7e83b0c01, 0xe883c57a77ccbb45, 0xd3b98a367b166454,
+ 0xff30f5f715e86753,}
+ ,}
+ ,
+ }
+ ,
+ {.th_name = "/1/2/3/4/5/6/7/8",
+ .th_namebytes = 16,
+ .th_pfx_hi = {
+ .pfx_len = 40,.pfx_count = 8,.pfx_overflow =
+ 0,.pfx_full_hash = 0xbf61949d6499859a,
+ .pfx_lens = {5, 10, 15, 20, 25, 30, 35, 40,}
+ ,
+ .pfx_hashes =
+ {0xa21d733c21450fb0, 0x2483307ff018e378, 0x359fc658c64a6901,
+ 0xe1f52cd7e83b0c01, 0xe883c57a77ccbb45, 0xd3b98a367b166454,
+ 0xb62b3a4a289f1f16, 0xbf61949d6499859a,}
+ ,}
+ ,
+ }
+ ,
+ {.th_name = "/1/2/3/4/5/6/7/8/9",
+ .th_namebytes = 18,
+ .th_pfx_hi = {
+ .pfx_len = 45,.pfx_count = 8,.pfx_overflow =
+ 1,.pfx_full_hash = 0x57b69dba5ce74acf,
+ .pfx_lens = {5, 10, 15, 20, 25, 30, 35, 40,}
+ ,
+ .pfx_hashes =
+ {0xa21d733c21450fb0, 0x2483307ff018e378, 0x359fc658c64a6901,
+ 0xe1f52cd7e83b0c01, 0xe883c57a77ccbb45, 0xd3b98a367b166454,
+ 0xb62b3a4a289f1f16, 0xbf61949d6499859a,}
+ ,}
+ ,
+ }
+ ,
+ {.th_name = "/1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20",
+ .th_namebytes = 51,
+ .th_pfx_hi = {
+ .pfx_len = 111,.pfx_count = 8,.pfx_overflow =
+ 1,.pfx_full_hash = 0x9c3c7384d4566a4a,
+ .pfx_lens = {5, 10, 15, 20, 25, 30, 35, 40,}
+ ,
+ .pfx_hashes =
+ {0xa21d733c21450fb0, 0x2483307ff018e378, 0x359fc658c64a6901,
+ 0xe1f52cd7e83b0c01, 0xe883c57a77ccbb45, 0xd3b98a367b166454,
+ 0xb62b3a4a289f1f16, 0xbf61949d6499859a,}
+ ,}
+ ,
+ }
+ ,
+ {.th_name = "/ccnx/list/\001",
+ .th_namebytes = 12,
+ .th_is_chunk_name = 1,
+ .th_pfx_hi = {
+ .pfx_len = 21,.pfx_count = 2,.pfx_overflow =
+ 0,.pfx_full_hash = 0x3016dc26837a1cd,
+ .pfx_lens = {8, 16,}
+ ,
+ .pfx_hashes = {0x4a235626854c2554, 0x6519af585bec2ef4,}
+ ,}
+ ,
+ }
+ ,
+};