adjust test

This commit is contained in:
mutouyun 2019-01-22 23:04:09 +08:00
parent 429e92983a
commit 61cc1fd863
2 changed files with 15 additions and 15 deletions

View File

@ -340,14 +340,14 @@ void Unit::test_prod_cons_performance() {
ipc::relat::multi, ipc::relat::multi,
ipc::trans::unicast> ipc::trans::unicast>
> el_arr_smu; > el_arr_smu;
ipc::detail::static_for(std::make_index_sequence<10>{}, [&el_arr_smu](auto index) { ipc::detail::static_for(std::make_index_sequence<8>{}, [&el_arr_smu](auto index) {
benchmark_prod_cons<1, decltype(index)::value + 1, LoopCount, void>(&el_arr_smu); benchmark_prod_cons<1, decltype(index)::value + 1, LoopCount, void>(&el_arr_smu);
}); });
ipc::detail::static_for(std::make_index_sequence<10>{}, [](auto index) { ipc::detail::static_for(std::make_index_sequence<8>{}, [](auto index) {
test_prod_cons<1, decltype(index)::value + 1, false>(); test_prod_cons<1, decltype(index)::value + 1, false>();
}); });
test_prod_cons<1, 10>(); // test & verify test_prod_cons<1, 8>(); // test & verify
ipc::circ::elem_array< ipc::circ::elem_array<
sizeof(msg_t), sizeof(msg_t),
@ -355,13 +355,13 @@ void Unit::test_prod_cons_performance() {
ipc::relat::multi, ipc::relat::multi,
ipc::trans::unicast> ipc::trans::unicast>
> el_arr_mmu; > el_arr_mmu;
ipc::detail::static_for(std::make_index_sequence<10>{}, [&el_arr_mmu](auto index) { ipc::detail::static_for(std::make_index_sequence<8>{}, [&el_arr_mmu](auto index) {
benchmark_prod_cons<1, decltype(index)::value + 1, LoopCount, void>(&el_arr_mmu); benchmark_prod_cons<1, decltype(index)::value + 1, LoopCount, void>(&el_arr_mmu);
}); });
ipc::detail::static_for(std::make_index_sequence<10>{}, [&el_arr_mmu](auto index) { ipc::detail::static_for(std::make_index_sequence<8>{}, [&el_arr_mmu](auto index) {
benchmark_prod_cons<decltype(index)::value + 1, 1, LoopCount, void>(&el_arr_mmu); benchmark_prod_cons<decltype(index)::value + 1, 1, LoopCount, void>(&el_arr_mmu);
}); });
ipc::detail::static_for(std::make_index_sequence<10>{}, [&el_arr_mmu](auto index) { ipc::detail::static_for(std::make_index_sequence<8>{}, [&el_arr_mmu](auto index) {
benchmark_prod_cons<decltype(index)::value + 1, decltype(index)::value + 1, LoopCount, void>(&el_arr_mmu); benchmark_prod_cons<decltype(index)::value + 1, decltype(index)::value + 1, LoopCount, void>(&el_arr_mmu);
}); });
@ -371,13 +371,13 @@ void Unit::test_prod_cons_performance() {
ipc::relat::multi, ipc::relat::multi,
ipc::trans::broadcast> ipc::trans::broadcast>
> el_arr_mmb; > el_arr_mmb;
ipc::detail::static_for(std::make_index_sequence<10>{}, [&el_arr_mmb](auto index) { ipc::detail::static_for(std::make_index_sequence<8>{}, [&el_arr_mmb](auto index) {
benchmark_prod_cons<1, decltype(index)::value + 1, LoopCount, void>(&el_arr_mmb); benchmark_prod_cons<1, decltype(index)::value + 1, LoopCount, void>(&el_arr_mmb);
}); });
ipc::detail::static_for(std::make_index_sequence<10>{}, [&el_arr_mmb](auto index) { ipc::detail::static_for(std::make_index_sequence<8>{}, [&el_arr_mmb](auto index) {
benchmark_prod_cons<decltype(index)::value + 1, 1, LoopCount, void>(&el_arr_mmb); benchmark_prod_cons<decltype(index)::value + 1, 1, LoopCount, void>(&el_arr_mmb);
}); });
ipc::detail::static_for(std::make_index_sequence<10>{}, [&el_arr_mmb](auto index) { ipc::detail::static_for(std::make_index_sequence<8>{}, [&el_arr_mmb](auto index) {
benchmark_prod_cons<decltype(index)::value + 1, decltype(index)::value + 1, LoopCount, void>(&el_arr_mmb); benchmark_prod_cons<decltype(index)::value + 1, decltype(index)::value + 1, LoopCount, void>(&el_arr_mmb);
}); });
} }
@ -392,7 +392,7 @@ void Unit::test_queue() {
queue.attach(cq); queue.attach(cq);
QVERIFY(queue.detach() != nullptr); QVERIFY(queue.detach() != nullptr);
ipc::detail::static_for(std::make_index_sequence<10>{}, [](auto index) { ipc::detail::static_for(std::make_index_sequence<8>{}, [](auto index) {
benchmark_prod_cons<1, decltype(index)::value + 1, LoopCount>((ipc::queue<msg_t>*)nullptr); benchmark_prod_cons<1, decltype(index)::value + 1, LoopCount>((ipc::queue<msg_t>*)nullptr);
}); });
} }

View File

@ -403,10 +403,10 @@ void Unit::test_route_rtt() {
} }
void Unit::test_route_performance() { void Unit::test_route_performance() {
ipc::detail::static_for(std::make_index_sequence<10>{}, [](auto index) { ipc::detail::static_for(std::make_index_sequence<8>{}, [](auto index) {
test_prod_cons<ipc::route, 1, decltype(index)::value + 1, false>(); test_prod_cons<ipc::route, 1, decltype(index)::value + 1, false>();
}); });
test_prod_cons<ipc::route, 1, 10>(); // test & verify test_prod_cons<ipc::route, 1, 8>(); // test & verify
} }
void Unit::test_channel() { void Unit::test_channel() {
@ -471,13 +471,13 @@ void Unit::test_channel_rtt() {
} }
void Unit::test_channel_performance() { void Unit::test_channel_performance() {
ipc::detail::static_for(std::make_index_sequence<10>{}, [](auto index) { ipc::detail::static_for(std::make_index_sequence<8>{}, [](auto index) {
test_prod_cons<ipc::channel, 1, decltype(index)::value + 1, false>(); test_prod_cons<ipc::channel, 1, decltype(index)::value + 1, false>();
}); });
ipc::detail::static_for(std::make_index_sequence<10>{}, [](auto index) { ipc::detail::static_for(std::make_index_sequence<8>{}, [](auto index) {
test_prod_cons<ipc::channel, decltype(index)::value + 1, 1, false>(); test_prod_cons<ipc::channel, decltype(index)::value + 1, 1, false>();
}); });
ipc::detail::static_for(std::make_index_sequence<10>{}, [](auto index) { ipc::detail::static_for(std::make_index_sequence<8>{}, [](auto index) {
test_prod_cons<ipc::channel, decltype(index)::value + 1, test_prod_cons<ipc::channel, decltype(index)::value + 1,
decltype(index)::value + 1, false>(); decltype(index)::value + 1, false>();
}); });