SynchronizedTestLib.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright 2012-present Facebook, Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #pragma once
  17. // We have mutex types outside of folly that we want to test with Synchronized.
  18. // Make it easy for mutex implementators to test their classes with
  19. // Synchronized by just having a test like:
  20. //
  21. // class MyMutex { ... };
  22. //
  23. // TEST(Synchronized, Basic) {
  24. // testBasic<MyMutex>();
  25. // }
  26. //
  27. // ... similar for testConcurrency, testDualLocking, etc.
  28. namespace folly {
  29. namespace sync_tests {
  30. template <class Mutex>
  31. void testBasic();
  32. template <class Mutex>
  33. void testDeprecated();
  34. template <class Mutex>
  35. void testConcurrency();
  36. template <class Mutex>
  37. void testAcquireLocked();
  38. template <class Mutex>
  39. void testAcquireLockedWithConst();
  40. template <class Mutex>
  41. void testDualLockingWithConst();
  42. template <class Mutex>
  43. void testDualLocking();
  44. template <class Mutex>
  45. void testDualLockingWithConst();
  46. template <class Mutex>
  47. void testTimed();
  48. template <class Mutex>
  49. void testTimedShared();
  50. template <class Mutex>
  51. void testTimedSynchronizedDeprecated();
  52. template <class Mutex>
  53. void testTimedSynchronizedWithConst();
  54. template <class Mutex>
  55. void testConstCopy();
  56. template <class Mutex>
  57. void testInPlaceConstruction();
  58. } // namespace sync_tests
  59. } // namespace folly
  60. #include <folly/test/SynchronizedTestLib-inl.h>