Moderator: Andres Valverde
beneficii wrote:How does one go about debugging a program designed for WinBoard, where you are trying to test the clock, the interface with the GUI, and the interaction of the interface and the engine itself? I'm not sure how to go about this. I tried putting the input in the pipe myself, but that didn't work.
Dann Corbit wrote:beneficii wrote:How does one go about debugging a program designed for WinBoard, where you are trying to test the clock, the interface with the GUI, and the interaction of the interface and the engine itself? I'm not sure how to go about this. I tried putting the input in the pipe myself, but that didn't work.
Why didn't it work when you put the input into the pipe yourself?
There is no reason why you should not be able to create unit tests in this way.
Out of curiosity, have you definitely turned buffering off for both standards input and standard output?
H.G.Muller wrote:I use getchar() for all input, but I guess that amounts to the same thing. And during the search I would periodically peek the pipe (when analyzing / pondering) or read the clock (while thinking) to see if I have to abort the search.
beneficii wrote:OK, I got the program to respond with the features (though I can't ever seem to get Fruit to do that, which is strange). Nevertheless, when I play around in the Console window it never does anything more, but now WinBoard can't initialize it, because it crashes. So in the Console window it doesn't crash, but in WinBoard it does not.
What is a full list of commands that are sent to the engine when WinBoard initializes, so that I can test them?
EDIT: I'm able to get FairyMax to respond.
Dann Corbit wrote:beneficii wrote:OK, I got the program to respond with the features (though I can't ever seem to get Fruit to do that, which is strange). Nevertheless, when I play around in the Console window it never does anything more, but now WinBoard can't initialize it, because it crashes. So in the Console window it doesn't crash, but in WinBoard it does not.
What is a full list of commands that are sent to the engine when WinBoard initializes, so that I can test them?
EDIT: I'm able to get FairyMax to respond.
Can you post your I/O routines?
Dann Corbit wrote:How do you open ipipe?
int unbuffered_input(int init)
{
static int pipe;
static HANDLE inp;
DWORD cnt;
if(init)
{ inp = GetStdHandle(STD_INPUT_HANDLE);
} else
{ if(!PeekNamedPipe(inp, NULL, 0, NULL, &cnt, NULL)) return 1;
return cnt;
}
}
Return to Programming and Technical Discussions
Users browsing this forum: No registered users and 21 guests