# Using Dispatch Internals for Testing

**URL:** <https://forums.swift.org/t/using-dispatch-internals-for-testing/34769>\
**Category:** Core Libraries\
**Tags:** dispatch, testing, libdispatch\
**Created:** [March 25, 2020, 2:50am UTC](https://forums.swift.org/t/using-dispatch-internals-for-testing/34769 "2020-03-25T02:50:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sveinhal](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/sveinhal/32/3992_2.png) [@sveinhal](https://forums.swift.org/u/sveinhal)\
**Post date:** [March 25, 2020, 9:07am UTC](https://forums.swift.org/t/using-dispatch-internals-for-testing/34769/2 "2020-03-25T09:07:33Z")

</div>

> [@SlaunchaMan](#):
>
> ```swift
> func currentQueueName() -> String? { 
> let name = __dispatch_queue_get_label(nil) 
> return String(cString: name, encoding: .utf8) 
> }
> 
> ```

I've resorted to the same trick in my tests: [Dispatch precondition false positive?](https://forums.swift.org/t/dispatch-precondition-false-positive/28498)

---

_[View the full topic](https://forums.swift.org/t/using-dispatch-internals-for-testing/34769)._
