int
run_main (int, ACE_TCHAR *[])
{
  ACE_START_TEST (ACE_TEXT ("Reactor_Dispatch_Order_Test"));

  int result = 0;
  ACE_Select_Reactor select_reactor_impl;
  ACE_Reactor select_reactor (&select_reactor_impl);
  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Testing ACE_Select_Reactor\n")));
  if (!test_reactor_dispatch_order (select_reactor))
    ++result;

  // Winsock 2 things are needed for WFMO_Reactor.
#if defined (ACE_WIN32) && \
    (defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0))

  ACE_WFMO_Reactor wfmo_reactor_impl;
  ACE_Reactor wfmo_reactor (&wfmo_reactor_impl);
  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Testing ACE_WFMO_Reactor\n")));
  if (!test_reactor_dispatch_order (wfmo_reactor))
    ++result;

#endif /* ACE_WIN32 && ACE_HAS_WINSOCK2 */

  ACE_END_TEST;
  return result;
}
int
run_main (int argc, ACE_TCHAR *argv[])
{
    ACE_START_TEST (ACE_TEXT ("MT_Reactor_Upcall_Test"));

#if defined (ACE_HAS_THREADS)

    // ACE_LOG_MSG->clr_flags (ACE_Log_Msg::VERBOSE_LITE);

    int result =
        parse_args (argc, argv);

    if (result != 0)
        return result;

    ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Testing TP Reactor\n")));

    ACE_TP_Reactor tp_reactor_impl;
    ACE_Reactor tp_reactor (&tp_reactor_impl);

    test_reactor_upcall (tp_reactor);

#if defined (ACE_HAS_EVENT_POLL)

    ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Testing Dev Poll Reactor\n")));

    ACE_Dev_Poll_Reactor dev_poll_reactor_impl;
    dev_poll_reactor_impl.restart (true);
    ACE_Reactor dev_poll_reactor (&dev_poll_reactor_impl);

    test_reactor_upcall (dev_poll_reactor);

#endif /* ACE_HAS_EVENT_POLL */

#if defined (ACE_WIN32) && \
    (defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0))

    ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Testing WFMO Reactor\n")));

    ACE_WFMO_Reactor wfmo_reactor_impl;
    ACE_Reactor wfmo_reactor (&wfmo_reactor_impl);

    test_reactor_upcall (wfmo_reactor);

#endif /* ACE_WIN32 && ACE_HAS_WINSOCK2 */

#else /* ACE_HAS_THREADS */
    ACE_UNUSED_ARG(argc);
    ACE_UNUSED_ARG(argv);

    ACE_ERROR ((LM_INFO,
                ACE_TEXT ("threads not supported on this platform\n")));

#endif /* ACE_HAS_THREADS */

    ACE_END_TEST;
    return 0;
}
int
run_main (int, ACE_TCHAR *[])
{
  ACE_START_TEST (ACE_TEXT ("Reactor_Notification_Queue_Test"));

#if !defined(ACE_HAS_REACTOR_NOTIFICATION_QUEUE)
  ACE_DEBUG ((LM_INFO,
              ACE_TEXT ("Notification queue disabled, ")
              ACE_TEXT ("small test version, ")
              ACE_TEXT ("which is of no practical use\n")));

  int max_notifications = 16;
#else
  int max_notifications = 1024 * 1024;
#endif /* ACE_HAS_THREADS */

  {
    ACE_Reactor select_reactor (
        new ACE_Select_Reactor,
        1);

    Event_Handler handler(&select_reactor,
                          max_notifications,
                          "Select_Reactor");

    handler.run ();
  }

  {
    ACE_Reactor tp_reactor (new ACE_TP_Reactor,
                            1);
    Event_Handler handler(&tp_reactor,
                          max_notifications,
                          "TP_Reactor");
    handler.run();
  }

#if 0
  /// @@todo: Need to talk to Irfan to see how the WFMO handles this.
#if defined (ACE_WIN32)
  {
    ACE_Reactor wfmo_reactor (new ACE_WFMO_Reactor,
                              1);

    Event_Handler handler(&wfmo_reactor,
                          max_notifications,
                          "WFMO_Reactor");
    handler.run();
  }
#endif /*ACE_WIN32*/
#endif /*if 0 */
  ACE_END_TEST;
  return 0;
}