mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Clang-format tests, examples, libraries, benchmarks, etc.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
3252ecc7a4
commit
46e9cdb7fe
@@ -13,7 +13,6 @@
|
||||
#include "main.h"
|
||||
#include <Eigen/ThreadPool>
|
||||
|
||||
|
||||
// Visual studio doesn't implement a rand_r() function since its
|
||||
// implementation of rand() is already thread safe
|
||||
int rand_reentrant(unsigned int* s) {
|
||||
@@ -25,8 +24,7 @@ int rand_reentrant(unsigned int* s) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void test_basic_runqueue()
|
||||
{
|
||||
void test_basic_runqueue() {
|
||||
RunQueue<int, 4> q;
|
||||
// Check empty state.
|
||||
VERIFY(q.Empty());
|
||||
@@ -117,8 +115,7 @@ void test_basic_runqueue()
|
||||
// 1 element (either front or back at random). So queue always contains at least
|
||||
// 1 element, but otherwise changes chaotically. Another thread constantly tests
|
||||
// that the queue is not claimed to be empty.
|
||||
void test_empty_runqueue()
|
||||
{
|
||||
void test_empty_runqueue() {
|
||||
RunQueue<int, 4> q;
|
||||
q.PushFront(1);
|
||||
std::atomic<bool> done(false);
|
||||
@@ -157,8 +154,7 @@ void test_empty_runqueue()
|
||||
// Stress is a chaotic random test.
|
||||
// One thread (owner) calls PushFront/PopFront, other threads call PushBack/
|
||||
// PopBack. Ensure that we don't crash, deadlock, and all sanity checks pass.
|
||||
void test_stress_runqueue()
|
||||
{
|
||||
void test_stress_runqueue() {
|
||||
static const int kEvents = 1 << 18;
|
||||
RunQueue<int, 8> q;
|
||||
std::atomic<int> total(0);
|
||||
@@ -227,8 +223,7 @@ void test_stress_runqueue()
|
||||
VERIFY(total.load() == 0);
|
||||
}
|
||||
|
||||
EIGEN_DECLARE_TEST(cxx11_runqueue)
|
||||
{
|
||||
EIGEN_DECLARE_TEST(cxx11_runqueue) {
|
||||
CALL_SUBTEST_1(test_basic_runqueue());
|
||||
CALL_SUBTEST_2(test_empty_runqueue());
|
||||
CALL_SUBTEST_3(test_stress_runqueue());
|
||||
|
||||
Reference in New Issue
Block a user