]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Remove the Qt4 regression tests because these are too hard to maintain
authorBart Van Assche <bvanassche@acm.org>
Sun, 23 Oct 2011 15:21:48 +0000 (15:21 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 23 Oct 2011 15:21:48 +0000 (15:21 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12220

13 files changed:
drd/tests/Makefile.am
drd/tests/qt4_atomic.cpp [deleted file]
drd/tests/qt4_atomic.stderr.exp [deleted file]
drd/tests/qt4_atomic.vgtest [deleted file]
drd/tests/qt4_mutex.cpp [deleted file]
drd/tests/qt4_mutex.stderr.exp [deleted file]
drd/tests/qt4_mutex.vgtest [deleted file]
drd/tests/qt4_rwlock.cpp [deleted file]
drd/tests/qt4_rwlock.stderr.exp [deleted file]
drd/tests/qt4_rwlock.vgtest [deleted file]
drd/tests/qt4_semaphore.cpp [deleted file]
drd/tests/qt4_semaphore.stderr.exp [deleted file]
drd/tests/qt4_semaphore.vgtest [deleted file]

index 94b2f3d2631ecc2b0bacbbbc37444647bddf0fb2..f13e4cfddd20cc1da4ce5d3c8ae1790d6f5fcfa7 100644 (file)
@@ -189,14 +189,6 @@ EXTRA_DIST =                                        \
        pth_spinlock.vgtest                         \
        pth_uninitialized_cond.stderr.exp           \
        pth_uninitialized_cond.vgtest               \
-       qt4_atomic.stderr.exp                       \
-       qt4_atomic.vgtest                           \
-       qt4_mutex.stderr.exp                        \
-       qt4_mutex.vgtest                            \
-       qt4_rwlock.stderr.exp                       \
-       qt4_rwlock.vgtest                           \
-       qt4_semaphore.stderr.exp                    \
-       qt4_semaphore.vgtest                        \
        read_and_free_race.stderr.exp               \
        read_and_free_race.vgtest                   \
        recursive_mutex.stderr.exp-linux            \
diff --git a/drd/tests/qt4_atomic.cpp b/drd/tests/qt4_atomic.cpp
deleted file mode 100644 (file)
index b3b84f6..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/// Test program that uses the QAtomicInt class.
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#include "config.h"
-#include <QAtomicInt>     // class QAtomicInt
-#include <cassert>
-#include <cstdio>         // fprintf()
-#include <cstdlib>        // atoi()
-#include <new>
-#include <pthread.h>      // pthread_barrier_t
-#include <vector>
-
-
-static pthread_barrier_t s_barrier;
-static QAtomicInt* s_pAtomicInt;
-
-
-void* thread_func(void* pArg)
-{
-  const int iArg = *reinterpret_cast<int*>(pArg);
-
-  pthread_barrier_wait(&s_barrier);
-
-  while (! s_pAtomicInt->testAndSetOrdered(iArg, iArg + 1))
-    ;
-
-  return NULL;
-}
-
-int main(int argc, char** argv)
-{
-  int i;
-  const int n_threads = 10;
-  std::vector<int>       thread_arg(n_threads);
-  std::vector<pthread_t> tid(n_threads);
-
-  fprintf(stderr, "Start of test.\n");
-
-  pthread_barrier_init(&s_barrier, 0, n_threads);
-  s_pAtomicInt = new QAtomicInt();
-  for (i = 0; i < n_threads; i++)
-  {
-    thread_arg[i] = i;
-    pthread_create(&tid[i], 0, thread_func, &thread_arg[i]);
-  }
-  for (i = 0; i < n_threads; i++)
-  {
-    pthread_join(tid[i], NULL);
-  }
-  pthread_barrier_destroy(&s_barrier);
-
-  if (*s_pAtomicInt == n_threads)
-    fprintf(stderr, "Test successful.\n");
-  else
-    fprintf(stderr, "Test failed: counter = %d, should be %d\n",
-            static_cast<int>(*s_pAtomicInt), n_threads);
-
-  delete s_pAtomicInt;
-  s_pAtomicInt = 0;
-
-  return 0;
-}
diff --git a/drd/tests/qt4_atomic.stderr.exp b/drd/tests/qt4_atomic.stderr.exp
deleted file mode 100644 (file)
index 21dba22..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-Start of test.
-Test successful.
-
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
diff --git a/drd/tests/qt4_atomic.vgtest b/drd/tests/qt4_atomic.vgtest
deleted file mode 100644 (file)
index a35435a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-prereq: test -e qt4_atomic
-vgopts: --check-stack-var=yes
-prog: qt4_atomic
diff --git a/drd/tests/qt4_mutex.cpp b/drd/tests/qt4_mutex.cpp
deleted file mode 100644 (file)
index c20b163..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/// Qt4 mutex test.
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#include "config.h"
-#include <QMutex>         // class QMutex
-#include <QThread>        // class QThread
-#include <cassert>
-#include <cstdio>         // fprintf()
-#include <cstdlib>        // atoi()
-#include <new>
-#include <pthread.h>      // pthread_barrier_t
-#include <vector>
-
-
-static pthread_barrier_t s_barrier;
-static QMutex* s_pMutex;
-static int s_iterations;
-static int s_counter;
-
-
-class IncThread: public QThread
-{
-  virtual void run();
-};
-
-void IncThread::run()
-{
-  int i;
-
-  pthread_barrier_wait(&s_barrier);
-  for (i = s_iterations; i > 0; i--)
-  {
-    s_pMutex->lock();
-    s_counter++;
-    s_pMutex->unlock();
-  }
-}
-
-int main(int argc, char** argv)
-{
-  int i;
-  const int n_threads = 10;
-  std::vector<QThread*> tid(n_threads);
-
-  s_iterations = argc > 1 ? atoi(argv[1]) : 1000;
-
-  fprintf(stderr, "Start of test.\n");
-
-  {
-    // Stack-allocated mutex.
-    QMutex M(QMutex::Recursive);
-    M.lock();
-    assert(M.tryLock());
-    M.unlock();
-    M.unlock();
-  }
-#if defined(HAVE_QTCORE_QMUTEX_TRYLOCK_INT)
-  {
-    QMutex M(QMutex::NonRecursive);
-    assert(M.tryLock(1));
-    assert(! M.tryLock(1));
-    M.unlock();
-  }
-#endif
-
-  pthread_barrier_init(&s_barrier, 0, n_threads);
-  s_pMutex = new QMutex();
-  for (i = 0; i < n_threads; i++)
-  {
-    tid[i] = new IncThread;
-    tid[i]->start();
-  }
-  for (i = 0; i < n_threads; i++)
-  {
-    tid[i]->wait();
-    delete tid[i];
-  }
-  delete s_pMutex;
-  s_pMutex = 0;
-  pthread_barrier_destroy(&s_barrier);
-
-  if (s_counter == n_threads * s_iterations)
-    fprintf(stderr, "Test successful.\n");
-  else
-    fprintf(stderr, "Test failed: counter = %d, should be %d\n",
-            s_counter, n_threads * s_iterations);
-
-  return 0;
-}
diff --git a/drd/tests/qt4_mutex.stderr.exp b/drd/tests/qt4_mutex.stderr.exp
deleted file mode 100644 (file)
index 21dba22..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-Start of test.
-Test successful.
-
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
diff --git a/drd/tests/qt4_mutex.vgtest b/drd/tests/qt4_mutex.vgtest
deleted file mode 100644 (file)
index 1015fff..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-prereq: test -e qt4_mutex
-vgopts: --check-stack-var=yes
-prog: qt4_mutex
diff --git a/drd/tests/qt4_rwlock.cpp b/drd/tests/qt4_rwlock.cpp
deleted file mode 100644 (file)
index db9cf24..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/// Qt4 reader-writer lock test.
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#include <QThread>               // class QThread
-#include <QReadWriteLock>        // class QReadWriteLock
-#include <cstdio>                // fprintf()
-#include <cstdlib>               // atoi()
-#include <new>
-#include <pthread.h>             // pthread_barrier_t
-#include <vector>
-
-
-static pthread_barrier_t s_barrier;
-static QReadWriteLock* s_pRWlock;
-static int s_iterations;
-static int s_counter;
-
-
-class IncThread: public QThread
-{
-public:
-  IncThread();
-  virtual ~IncThread();
-
-private:
-  virtual void run();
-};
-
-IncThread::IncThread()
-{ }
-
-IncThread::~IncThread()
-{ }
-
-void IncThread::run()
-{
-  int i;
-
-  pthread_barrier_wait(&s_barrier);
-  for (i = s_iterations; i > 0; i--)
-  {
-    s_pRWlock->lockForWrite();
-    s_counter++;
-    s_pRWlock->unlock();
-  }
-}
-
-int main(int argc, char** argv)
-{
-  int i;
-  const int n_threads = 10;
-  std::vector<QThread*> tid(n_threads);
-
-  s_iterations = argc > 1 ? atoi(argv[1]) : 1000;
-
-  fprintf(stderr, "Start of test.\n");
-
-  {
-    // Stack-allocated reader-writer lock.
-    QReadWriteLock RWL;
-    RWL.lockForRead();
-    RWL.unlock();
-    RWL.lockForWrite();
-    RWL.unlock();
-  }
-
-  pthread_barrier_init(&s_barrier, 0, n_threads);
-  s_pRWlock = new QReadWriteLock();
-  for (i = 0; i < n_threads; i++)
-  {
-    tid[i] = new IncThread;
-    tid[i]->start();
-  }
-  for (i = 0; i < n_threads; i++)
-  {
-    tid[i]->wait();
-    delete tid[i];
-  }
-  delete s_pRWlock;
-  s_pRWlock = 0;
-  pthread_barrier_destroy(&s_barrier);
-
-  if (s_counter == n_threads * s_iterations)
-    fprintf(stderr, "Test successful.\n");
-  else
-    fprintf(stderr, "Test failed: counter = %d, should be %d\n",
-            s_counter, n_threads * s_iterations);
-
-  return 0;
-}
diff --git a/drd/tests/qt4_rwlock.stderr.exp b/drd/tests/qt4_rwlock.stderr.exp
deleted file mode 100644 (file)
index 21dba22..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-Start of test.
-Test successful.
-
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
diff --git a/drd/tests/qt4_rwlock.vgtest b/drd/tests/qt4_rwlock.vgtest
deleted file mode 100644 (file)
index 8619d93..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-prereq: test -e qt4_rwlock
-vgopts: --check-stack-var=yes
-prog: qt4_rwlock
diff --git a/drd/tests/qt4_semaphore.cpp b/drd/tests/qt4_semaphore.cpp
deleted file mode 100644 (file)
index 5143c75..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/// Qt4 semaphore test.
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#include <QThread>           // class QMutex
-#include <QSemaphore>        // class QSemaphore
-#include <cstdio>            // fprintf()
-#include <cstdlib>           // atoi()
-#include <new>
-#include <pthread.h>         // pthread_barrier_t
-#include <vector>
-
-
-static pthread_barrier_t s_barrier;
-static QSemaphore* s_pSema;
-static int s_iterations;
-static int s_counter;
-
-
-class IncThread: public QThread
-{
-  virtual void run();
-};
-
-void IncThread::run()
-{
-  int i;
-
-  pthread_barrier_wait(&s_barrier);
-  for (i = s_iterations; i > 0; i--)
-  {
-    s_pSema->acquire();
-    s_counter++;
-    s_pSema->release();
-  }
-}
-
-int main(int argc, char** argv)
-{
-  int i;
-  const int n_threads = 10;
-  std::vector<QThread*> tid(n_threads);
-
-  s_iterations = argc > 1 ? atoi(argv[1]) : 1000;
-
-  fprintf(stderr, "Start of test.\n");
-
-  {
-    // Stack-allocated semaphore.
-    QSemaphore S(1);
-    S.acquire();
-    S.release();
-    S.acquire();
-    S.release();
-  }
-
-  pthread_barrier_init(&s_barrier, 0, n_threads);
-  s_pSema = new QSemaphore(1);
-  for (i = 0; i < n_threads; i++)
-  {
-    tid[i] = new IncThread;
-    tid[i]->start();
-  }
-  for (i = 0; i < n_threads; i++)
-  {
-    tid[i]->wait();
-    delete tid[i];
-  }
-  delete s_pSema;
-  s_pSema = 0;
-  pthread_barrier_destroy(&s_barrier);
-
-  if (s_counter == n_threads * s_iterations)
-    fprintf(stderr, "Test successful.\n");
-  else
-    fprintf(stderr, "Test failed: counter = %d, should be %d\n",
-            s_counter, n_threads * s_iterations);
-
-  return 0;
-}
diff --git a/drd/tests/qt4_semaphore.stderr.exp b/drd/tests/qt4_semaphore.stderr.exp
deleted file mode 100644 (file)
index 21dba22..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-Start of test.
-Test successful.
-
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
diff --git a/drd/tests/qt4_semaphore.vgtest b/drd/tests/qt4_semaphore.vgtest
deleted file mode 100644 (file)
index 771ac15..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-prereq: test -e qt4_semaphore
-vgopts: --check-stack-var=yes
-prog: qt4_semaphore