MCPcopy Create free account
hub / github.com/NetSys/bess / l2_forward_flush_test

Function l2_forward_flush_test

core/modules/l2_forward.cc:446–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446static void l2_forward_flush_test() {
447 int ret;
448 struct l2_table l2tbl;
449
450 uint64_t addr1 = 0x0123456701234567;
451 uint16_t index1 = 0x0123;
452 uint16_t gate_index;
453
454 ret = l2_init(&l2tbl, 4, 4);
455 DCHECK_EQ(ret, 0);
456
457 ret = l2_add_entry(&l2tbl, addr1, index1);
458 DCHECK_EQ(ret, 0);
459
460 ret = l2_flush(&l2tbl);
461 DCHECK_EQ(ret, 0);
462
463 ret = l2_find(&l2tbl, addr1, &gate_index);
464 DCHECK_LT(ret, 0);
465
466 ret = l2_deinit(&l2tbl);
467 DCHECK_EQ(ret, 0);
468}
469
470static void l2_forward_collision_test() {
471 const int h_size = 4;

Callers 1

test_allFunction · 0.85

Calls 5

l2_initFunction · 0.85
l2_add_entryFunction · 0.85
l2_flushFunction · 0.85
l2_findFunction · 0.85
l2_deinitFunction · 0.85

Tested by 1

test_allFunction · 0.68