Project

General

Profile

Actions

Bug #711

closed
KD KD

WTestEnvironment and reentrant eventloops.

Bug #711: WTestEnvironment and reentrant eventloops.

Added by Koen Deforche over 15 years ago. Updated almost 15 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
02/07/2011
Due date:
% Done:

0%

Estimated time:

Description

(From Antonio Mancina:)

I'm trying to solve the following problem.

In the normal workflow of my application, when the user ask for a new
entity to be created, a modal dialog is created to let the user insert
a name for this entity.
When the corresponding OK button is pressed, a minimal amount of input
verification is done before accepting the data provided by the user
(typically the name must be comprised of valid characters).

I'd like to simulate this with a test environment, in order to test the
bunch of code which verifies the input, but I'm facing the following
problems.

1) If I let a single threaded test environment to instantiate the modal
window by simulating the newEntity button click, it gets stuck on the
emit call (which will end up showing the modal window, but no one is
gonna press the ok button).

2) If I prepare a double threaded environment and let one thread emit
the OK click signal belonging to the modal window, the other thread
stuck on the NewEntityButton~~clicked>emit(), stays there even after
the other thread issued the DialogModalOkButton
clicked()~~>emit().

Since I'm almost new to Wt, I could have missed something in here.
What's the standard way to address such an issue?

Solution: provide signals in WTestEnvironment, which invoked
whenever a recursive eventloop is started, with contextual information
(the dialog or other object involved). A listening slot could
then simulate interaction with the dialog itself:

WTestEnvironment:

  Signal<WDialog *>& dialogExecuted(), Signal<WPopupMenu *>& popupMenuExecuted(), ...

KD Updated by Koen Deforche about 15 years ago Actions #1

  • Status changed from New to Resolved
  • Assignee set to Koen Deforche
  • Target version set to 3.1.11

Hey,

I've implemented this in git.

Regards,
koen

KD Updated by Koen Deforche almost 15 years ago Actions #2

  • Status changed from Resolved to Closed

Resolved in Wt 3.1.11

Actions

Also available in: PDF Atom