for (uint i = 0; i < max; ++i) { if (i < value) {
ASSERT_EQ(sem.trywait(), true);
} else {
ASSERT_EQ(sem.trywait(), false);
}
}
}
TEST(Semaphore, single_separate) { for (uint i = 1; i < 10; i++) {
test_semaphore_single_separate(i);
}
}
TEST(Semaphore, single_combined) { for (uint i = 1; i < 10; i++) {
test_semaphore_single_combined(i);
}
}
TEST(Semaphore, many) { for (uint max = 0; max < 10; max++) { for (uint value = 0; value < max; value++) { for (uint inc = 1; inc <= max - value; inc++) {
test_semaphore_many(value, max, inc);
}
}
}
}
TEST(Semaphore, trywait) { for (uint max = 0; max < 10; max++) { for (uint value = 0; value < max; value++) {
test_semaphore_trywait(value, max);
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.