|
From: Luca C. <ce...@sy...> - 2013-05-17 16:58:49
|
Uh, noticed now that at line 155 the function goes as far as calling a "exit(0)" termination if a host is not found... This function was set to a "success or death" logic. Maybe it's better that I write down a different function for what I need... what do you think? Il 17/05/2013 18:37, Luca Cerutti ha scritto: > Doug, > I did not know of the ConsoleMessage() function. > > As of now the code calls the X3D_error function that uses the perror > function. > > I thought of the return value because I'd like the caller application to > manage the missing socket comunication (e.g. by trying a "server" > restart if it knows how to do it... which is my case). > > I'll apply your suggestion. > > Il 17/05/2013 18:33, doug sanden ha scritto: >>> Hi, >>> I've noticed that the initialization process of the EAI through >>> \src\libeai\EAI_C_Control.c -> X3D_Initialize >>> >>> only print error messages on the standard output if the initialization >>> goes wrong. >>> Since the same function could be used from a non-console application or >>> library, wouldn't it be better if it returns a boolean value or, even >>> better, an int error code? >>> >>> If you value it useful I could make the upgrade. >>> >> Luca, >> I haven't looked at the code but here's some thoughts that popped to mind: >> instead of printf() you could call ConsoleMessage() which is meant to show the message on non-console configurations (and default to printf on console configurations). Some configurations use statusbarHud.c which has a [!] menu button which then renders the messages as pixel text over the scene window. I think John gave the Android version a separate text window. >> If a return value would break something, could you do something like this: make that change but also change the name to int X3D_Initialize0() with a 0 in the name, and then make a function X3D_Initialize() with the old signature (that returns no value) and calls the 0() function? Then whoever can use the return value calls the 0 function and all the old code keeps calling the old way. >> -Doug >> ------------------------------------------------------------------------------ >> AlienVault Unified Security Management (USM) platform delivers complete >> security visibility with the essential security capabilities. Easily and >> efficiently configure, manage, and operate all of your security controls >> from a single console and one unified framework. Download a free trial. >> http://p.sf.net/sfu/alienvault_d2d >> _______________________________________________ >> FreeWRL-develop mailing list >> Fre...@li... >> https://lists.sourceforge.net/lists/listinfo/freewrl-develop >> > -- =============================================================== Luca Cerutti Profutura s.r.l. - Corso Tortona 17 - 10153 Torino phone: +39 (0)11 8392363 - fax: +39 (0)11 837802 e-mail: ce...@sy... http://www.synarea.com Le informazioni, i dati e le notizie contenute nella presente comunicazione e i relativi allegati sono di natura privata e come tali possono essere riservate e sono, comunque, destinate esclusivamente ai destinatari indicati in epigrafe. La diffusione, distribuzione e/o la copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p., sia ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di darcene immediata comunicazione anche inviando un messaggio di ritorno all’indirizzo e-mail del mittente. This e-mail (including attachments) is intended only for the recipient(s) named above. It may contain confidential or privileged information and should not be read, copied or otherwise used by any other person. If you are not the named recipient, please contact (ce...@sy...) and delete the e-mail from your system. Rif. D.L. 196/2003. =============================================================== |
|
From: doug s. <hig...@ho...> - 2013-05-17 17:30:09
|
>
> Uh, noticed now that at line 155 the function goes as far as calling a
> "exit(0)" termination if a host is not found...
>
> This function was set to a "success or death" logic. Maybe it's better
> that I write down a different function for what I need... what do you think?
Sounds good. Then if other configurations want to join your method they can do so at leisure.
Or another idea: move the exit(0) outside if not too hard, then do the wrapper function idea:
void X3D_Initialize()
{
int ierr = X3D_Initialize0();
if(ierr) exit(0);
}
Then you'd call the 0() function and the other guys would call the old one.
>
> Il 17/05/2013 18:37, Luca Cerutti ha scritto:
>> Doug,
>> I did not know of the ConsoleMessage() function.
>>
>> As of now the code calls the X3D_error function that uses the perror
>> function.
>>
>> I thought of the return value because I'd like the caller application to
>> manage the missing socket comunication (e.g. by trying a "server"
>> restart if it knows how to do it... which is my case).
>>
>> I'll apply your suggestion.
>>
>> Il 17/05/2013 18:33, doug sanden ha scritto:
>>>> Hi,
>>>> I've noticed that the initialization process of the EAI through
>>>> \src\libeai\EAI_C_Control.c -> X3D_Initialize
>>>>
>>>> only print error messages on the standard output if the initialization
>>>> goes wrong.
>>>> Since the same function could be used from a non-console application or
>>>> library, wouldn't it be better if it returns a boolean value or, even
>>>> better, an int error code?
>>>>
>>>> If you value it useful I could make the upgrade.
>>>>
>>> Luca,
>>> I haven't looked at the code but here's some thoughts that popped to mind:
>>> instead of printf() you could call ConsoleMessage() which is meant to show the message on non-console configurations (and default to printf on console configurations). Some configurations use statusbarHud.c which has a [!] menu button which then renders the messages as pixel text over the scene window. I think John gave the Android version a separate text window.
>>> If a return value would break something, could you do something like this: make that change but also change the name to int X3D_Initialize0() with a 0 in the name, and then make a function X3D_Initialize() with the old signature (that returns no value) and calls the 0() function? Then whoever can use the return value calls the 0 function and all the old code keeps calling the old way.
>>> -Doug
>>> ------------------------------------------------------------------------------
>>> AlienVault Unified Security Management (USM) platform delivers complete
>>> security visibility with the essential security capabilities. Easily and
>>> efficiently configure, manage, and operate all of your security controls
>>> from a single console and one unified framework. Download a free trial.
>>> http://p.sf.net/sfu/alienvault_d2d
>>> _______________________________________________
>>> FreeWRL-develop mailing list
>>> Fre...@li...
>>> https://lists.sourceforge.net/lists/listinfo/freewrl-develop
>>>
>>
>
>
> --
> ===============================================================
> Luca Cerutti
> Profutura s.r.l. - Corso Tortona 17 - 10153 Torino
> phone: +39 (0)11 8392363 - fax: +39 (0)11 837802
> e-mail: ce...@sy...
> http://www.synarea.com
>
> Le informazioni, i dati e le notizie contenute nella presente comunicazione e i relativi allegati sono di natura privata e come tali possono essere riservate e sono, comunque, destinate esclusivamente ai destinatari indicati in epigrafe. La diffusione, distribuzione e/o la copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p., sia ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di darcene immediata comunicazione anche inviando un messaggio di ritorno all’indirizzo e-mail del mittente.
>
> This e-mail (including attachments) is intended only for the recipient(s) named above. It may contain confidential or privileged information and should not be read, copied or otherwise used by any other person. If you are not the named recipient, please contact (ce...@sy...) and delete the e-mail from your system. Rif. D.L. 196/2003.
> ===============================================================
>
>
> ------------------------------------------------------------------------------
> AlienVault Unified Security Management (USM) platform delivers complete
> security visibility with the essential security capabilities. Easily and
> efficiently configure, manage, and operate all of your security controls
> from a single console and one unified framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> FreeWRL-develop mailing list
> Fre...@li...
> https://lists.sourceforge.net/lists/listinfo/freewrl-develop
|
|
From: doug s. <hig...@ho...> - 2013-05-18 13:17:29
|
>>
>> Uh, noticed now that at line 155 the function goes as far as calling a
>> "exit(0)" termination if a host is not found...
>>
>> This function was set to a "success or death" logic. Maybe it's better
>> that I write down a different function for what I need... what do you think?
> Sounds good. Then if other configurations want to join your method they can do so at leisure.
> Or another idea: move the exit(0) outside if not too hard, then do the wrapper function idea:
> void X3D_Initialize()
> {
> int ierr = X3D_Initialize0();
> if(ierr) exit(0);
> }
> Then you'd call the 0() function and the other guys would call the old one.
.
Oh - I'm looking at the code now. I was wrong on 2 counts:
1) Looks like X3D_initialize is in libeai -on the client side. I don't think it should get the ConsoleMessage treatment, because it will make linking libeai.lib and client harder.
2) And looks like there's only one place X3D_Initialize called, plus it's in some SWIG stuff. I think the SWIG stuff is already broken / out of date. So in that case you can change the function signature without doing a wrapper function.
-Doug
.
>>
>> Il 17/05/2013 18:37, Luca Cerutti ha scritto:
>>> Doug,
>>> I did not know of the ConsoleMessage() function.
>>>
>>> As of now the code calls the X3D_error function that uses the perror
>>> function.
>>>
>>> I thought of the return value because I'd like the caller application to
>>> manage the missing socket comunication (e.g. by trying a "server"
>>> restart if it knows how to do it... which is my case).
>>>
>>> I'll apply your suggestion.
>>>
>>> Il 17/05/2013 18:33, doug sanden ha scritto:
>>>>> Hi,
>>>>> I've noticed that the initialization process of the EAI through
>>>>> \src\libeai\EAI_C_Control.c -> X3D_Initialize
>>>>>
>>>>> only print error messages on the standard output if the initialization
>>>>> goes wrong.
>>>>> Since the same function could be used from a non-console application or
>>>>> library, wouldn't it be better if it returns a boolean value or, even
>>>>> better, an int error code?
>>>>>
>>>>> If you value it useful I could make the upgrade.
>>>>>
>>>> Luca,
>>>> I haven't looked at the code but here's some thoughts that popped to mind:
>>>> instead of printf() you could call ConsoleMessage() which is meant to show the message on non-console configurations (and default to printf on console configurations). Some configurations use statusbarHud.c which has a [!] menu button which then renders the messages as pixel text over the scene window. I think John gave the Android version a separate text window.
>>>> If a return value would break something, could you do something like this: make that change but also change the name to int X3D_Initialize0() with a 0 in the name, and then make a function X3D_Initialize() with the old signature (that returns no value) and calls the 0() function? Then whoever can use the return value calls the 0 function and all the old code keeps calling the old way.
>>>> -Doug
>>>> ------------------------------------------------------------------------------
>>>> AlienVault Unified Security Management (USM) platform delivers complete
>>>> security visibility with the essential security capabilities. Easily and
>>>> efficiently configure, manage, and operate all of your security controls
>>>> from a single console and one unified framework. Download a free trial.
>>>> http://p.sf.net/sfu/alienvault_d2d
>>>> _______________________________________________
>>>> FreeWRL-develop mailing list
>>>> Fre...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/freewrl-develop
>>>>
>>>
>>
>>
>> --
>> ===============================================================
>> Luca Cerutti
>> Profutura s.r.l. - Corso Tortona 17 - 10153 Torino
>> phone: +39 (0)11 8392363 - fax: +39 (0)11 837802
>> e-mail: ce...@sy...
>> http://www.synarea.com
>>
>> Le informazioni, i dati e le notizie contenute nella presente comunicazione e i relativi allegati sono di natura privata e come tali possono essere riservate e sono, comunque, destinate esclusivamente ai destinatari indicati in epigrafe. La diffusione, distribuzione e/o la copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p., sia ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di darcene immediata comunicazione anche inviando un messaggio di ritorno all’indirizzo e-mail del mittente.
>>
>> This e-mail (including attachments) is intended only for the recipient(s) named above. It may contain confidential or privileged information and should not be read, copied or otherwise used by any other person. If you are not the named recipient, please contact (ce...@sy...) and delete the e-mail from your system. Rif. D.L. 196/2003.
>> ===============================================================
>>
>>
>> ------------------------------------------------------------------------------
>> AlienVault Unified Security Management (USM) platform delivers complete
>> security visibility with the essential security capabilities. Easily and
>> efficiently configure, manage, and operate all of your security controls
>> from a single console and one unified framework. Download a free trial.
>> http://p.sf.net/sfu/alienvault_d2d
>> _______________________________________________
>> FreeWRL-develop mailing list
>> Fre...@li...
>> https://lists.sourceforge.net/lists/listinfo/freewrl-develop
> ------------------------------------------------------------------------------
> AlienVault Unified Security Management (USM) platform delivers complete
> security visibility with the essential security capabilities. Easily and
> efficiently configure, manage, and operate all of your security controls
> from a single console and one unified framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> FreeWRL-develop mailing list
> Fre...@li...
> https://lists.sourceforge.net/lists/listinfo/freewrl-develop
|
|
From: Paulo E. C. <pau...@gm...> - 2013-05-17 20:18:44
|
On 17/05/13 15:33, doug sanden wrote:
> Paulo,
>>>> Recently we were wondering if it's possible/how to do more automated
>>>> testing with graphical programs. We have a way to 'dump' a scene (as
>>>> text, showing scenegraph) to a file. And we have a way to do a screen
>>>> snapshot (to an image file). One more idea: have some way to specify
>>>> the number of loops to advance (perhaps also time?) But nothing
>>>> working today as automated test suite.
BTW, How can the scenegraph be dumped so I can have a look at it ?
>>> Paulo,
>>> There was also an idea of a record mode in freewrl: specifically:
>>> - number of frames
>>> - input: keystroke, mouse action
>>> - snapshot
>>> - dumpscene
>>> And perhaps put it in a special file format, for playback during testing.
>>> To make the number of frames smaller -so the tests run faster- the
>>> record mode could purposely run slow - pausing on each frame.
>>> -Doug
>> I've written a small perl test script that's using a library that I'm
>> currently maintaining that allows keyboard and mouse interactions when
>> running on a X11 env, it currently does the following:
>> - Opens freewrl with a given test wrl file.
>> - Takes a snapshot
>> - Goes to the next file
>>
>> I have the following problems:
>>
>> - Sometimes freewrl takes some time to load and gives no indication of
>> when it has finished rendering. We could use such hint in order to
>> trigger a snapshot after rendering rather than "sleeping" and hope it's
>> enough....
> .
> Perhaps for both fixture creation and later comparision testing the main program could be different or go into a different loop, holding off rendering until parsing is finished, or not counting frames until it's finished. A commandline parameter might put it into fixture mode or testing mode.
Yes, something like that, or even just write a debug message that we
could unequivocally match to it being ready. We could be hooking into
the STDOUT/STDERR of FreeWRL and upon detection of that message start
the test.
> .
>> - Currently the snapshot only seems to work with PNG which has a file is
>> not suitable for comparison with for instance a previous master version.
> .
> Because of compression? Is there a way to turn off compression? If so then it switch on a global testing mode parameter. Or is there more saved, such as the date and timestamp in the .png, causing a generic binary file compare to fail?
> (win32 saves .bmp which has no compression -great for testing- but it's a pain then emailing a screenshot because I have to use another tool to convert it to .png for cross-platform consumption)
> Q. instead of saving to any standard file format, don't we first get a binary blob from opengl somehow, and could we just save the blob and use it for comparison? Perhaps store widthxheight in another file (playback file?) in case someone wants to visually check a failed comparison? Or would we always know the widthxheight by setting the opengl window to a standard size for testing?
The PNG file format writes a timestamp in the end of the file. That's
why I was thinking of a GIF.
As for width x height that could be setup as a default convention, e.g.
the default window size or the -big layout.
> .
>> - It would be interesting to know how to move to a specific viewpoint
>> say 45 degrees to the left,right, up, down... without having to manually
>> do so by means of keyboard/mouse
>>
>> I'm not entirely sure that comparing image snapshots with a previous
>> known good image is the right way to do it but at least it exercises
>> some of the points you where making above.
>>
>> My idea based on your comments is somehow similar to this; If we imagine
>> a cylinder around the main item of a given test file perhaps we could do
>> the following....
>> - Open a test file
> .
> Good. Right now there are separate threads for reading/parsing the file, and the rendering loop. Perhaps in test mode there would need to be some counting of frames after load is finished.
> For example if just parsing is being tested, then the 1st frame after parsing is complete.
Yes that would make sense.
>> - Wait for rendering to finish.
> Some tests are needed for things like animation and routing, which happens over multiple frames. Some animation things are simple interpolators with a time or delta-time input.
> One idea is to save both frames-after-parsing and the double dtime value to go with it, during the test fixture generation:
> {int frame, double dtime, ?other?}
> then during test run, instead of using clock time substitute the saved dtime, to match the fixture run.
> .
>> - Take a snapshot
> .
> During fixture generation save the {snapshot, iframe#, dtime} (or else perhaps save the snapshot command keystroke?) and during testing save the snapshot on iframe#, then do a binary file compare
> .
>> - Move to a different viewpoint coordinate on the cylinder and take a
>> snapshot. and so on
>> - North, South, East, West, Above, Below
>> - Compare those snapshots with previously good known ones.
> .
> Some scenes and things you want to test are not single objects but rather spread out scenes, and sometimes the things being tested are not even graphical - such as routing and script tests that show up in the text console. So not every test could benefit from this exact sequence.
> The graphics window is a proxy for the scenegraph state. So one way to test the non-graphical stuff is by saving the scenegraph state. Except a problem: it's full of memory pointers, which aren't the same between runs (malloc creates them different each time), and we may be trying to change the scenegraph storage - the subject of our tests. And not all things are stored in the scenegraph. But for some tests some kind of pointer-neutralized dump of the scenegraph might make a good test fixture.
> .
That's why given my limited knowledge of how it all works in the inside
I'm shying away from that kind of testing.
Because the whole thing seems daunting in size, my initial approach is a
more conservative one where I prefer to think in small increments.
If we rush into wanting to have 100% test coverage we might risk
embarking in a never ending project on the side just for the testing.
> So I think we would need general / flexible approach to testing to cover all cases. I kind of like what Michel had been attempting, saving the mouse coordinates for playback.
> Perhaps what's needed is a playback file that records a lot of things, per post-parse frame#
> playback[i] = {iframe, dtime, keystrokes or NULL, mouse (xy,button sequence) or NULL, snapshot URL or NULL, scenegraph_dump URL or NULL, ?other?}
Having a format for a playback file that we could replay against the
window is a good idea.
Can you expand on what you mean by saving the mouse coordinates ?
> .
>> *This would obviously not cope well with moving objects in the scene but
>> that's a different ball game.
> .
> Perhaps the above detailed playback file approach would/could be made to cover the moving objects scenario?
> .
>> What do you guys think about this ?
>>
>> I've pushed my test script to github and it lives in the branch called
>> testing-freewrl.
>> More details about it here
>> https://github.com/pecastro/freewrl/commits/testing-freewrl
>>
The script is very basic and it's not really ready for consumption as it
has some stuff hardcoded in it.
|
|
From: doug s. <hig...@ho...> - 2013-05-17 20:58:28
|
>> Paulo,
>>>>> Recently we were wondering if it's possible/how to do more automated
>>>>> testing with graphical programs. We have a way to 'dump' a scene (as
>>>>> text, showing scenegraph) to a file. And we have a way to do a screen
>>>>> snapshot (to an image file). One more idea: have some way to specify
>>>>> the number of loops to advance (perhaps also time?) But nothing
>>>>> working today as automated test suite.
> BTW, How can the scenegraph be dumped so I can have a look at it ?
.
There are a few keystroke commands that will dump text to the console window:
'\' - regular dumpscene
'|' - dumpscene2 different algo but much the same output
'=' - list of named nodes
'+' - list of ROUTES
Notice there are memory pointers like 01CB0BE0 in there that would change with each run:
L1: node (01CB0BE0) (DEF ColumnPath) type OrientationInterpolator
Some address neutralization strategy would need to be figured out, to do comparisons.
.
>>>> Paulo,
>>>> There was also an idea of a record mode in freewrl: specifically:
>>>> - number of frames
>>>> - input: keystroke, mouse action
>>>> - snapshot
>>>> - dumpscene
>>>> And perhaps put it in a special file format, for playback during testing.
>>>> To make the number of frames smaller -so the tests run faster- the
>>>> record mode could purposely run slow - pausing on each frame.
>>>> -Doug
>>> I've written a small perl test script that's using a library that I'm
>>> currently maintaining that allows keyboard and mouse interactions when
>>> running on a X11 env, it currently does the following:
>>> - Opens freewrl with a given test wrl file.
>>> - Takes a snapshot
>>> - Goes to the next file
>>>
>>> I have the following problems:
>>>
>>> - Sometimes freewrl takes some time to load and gives no indication of
>>> when it has finished rendering. We could use such hint in order to
>>> trigger a snapshot after rendering rather than "sleeping" and hope it's
>>> enough....
>> .
>> Perhaps for both fixture creation and later comparision testing the main program could be different or go into a different loop, holding off rendering until parsing is finished, or not counting frames until it's finished. A commandline parameter might put it into fixture mode or testing mode.
> Yes, something like that, or even just write a debug message that we
> could unequivocally match to it being ready. We could be hooking into
> the STDOUT/STDERR of FreeWRL and upon detection of that message start
> the test.
>> .
>>> - Currently the snapshot only seems to work with PNG which has a file is
>>> not suitable for comparison with for instance a previous master version.
>> .
>> Because of compression? Is there a way to turn off compression? If so then it switch on a global testing mode parameter. Or is there more saved, such as the date and timestamp in the .png, causing a generic binary file compare to fail?
>> (win32 saves .bmp which has no compression -great for testing- but it's a pain then emailing a screenshot because I have to use another tool to convert it to .png for cross-platform consumption)
>> Q. instead of saving to any standard file format, don't we first get a binary blob from opengl somehow, and could we just save the blob and use it for comparison? Perhaps store widthxheight in another file (playback file?) in case someone wants to visually check a failed comparison? Or would we always know the widthxheight by setting the opengl window to a standard size for testing?
> The PNG file format writes a timestamp in the end of the file. That's
> why I was thinking of a GIF.
> As for width x height that could be setup as a default convention, e.g.
> the default window size or the -big layout.
>> .
>>> - It would be interesting to know how to move to a specific viewpoint
>>> say 45 degrees to the left,right, up, down... without having to manually
>>> do so by means of keyboard/mouse
>>>
>>> I'm not entirely sure that comparing image snapshots with a previous
>>> known good image is the right way to do it but at least it exercises
>>> some of the points you where making above.
>>>
>>> My idea based on your comments is somehow similar to this; If we imagine
>>> a cylinder around the main item of a given test file perhaps we could do
>>> the following....
>>> - Open a test file
>> .
>> Good. Right now there are separate threads for reading/parsing the file, and the rendering loop. Perhaps in test mode there would need to be some counting of frames after load is finished.
>> For example if just parsing is being tested, then the 1st frame after parsing is complete.
> Yes that would make sense.
>>> - Wait for rendering to finish.
>> Some tests are needed for things like animation and routing, which happens over multiple frames. Some animation things are simple interpolators with a time or delta-time input.
>> One idea is to save both frames-after-parsing and the double dtime value to go with it, during the test fixture generation:
>> {int frame, double dtime, ?other?}
>> then during test run, instead of using clock time substitute the saved dtime, to match the fixture run.
>> .
>>> - Take a snapshot
>> .
>> During fixture generation save the {snapshot, iframe#, dtime} (or else perhaps save the snapshot command keystroke?) and during testing save the snapshot on iframe#, then do a binary file compare
>> .
>>> - Move to a different viewpoint coordinate on the cylinder and take a
>>> snapshot. and so on
>>> - North, South, East, West, Above, Below
>>> - Compare those snapshots with previously good known ones.
>> .
>> Some scenes and things you want to test are not single objects but rather spread out scenes, and sometimes the things being tested are not even graphical - such as routing and script tests that show up in the text console. So not every test could benefit from this exact sequence.
>> The graphics window is a proxy for the scenegraph state. So one way to test the non-graphical stuff is by saving the scenegraph state. Except a problem: it's full of memory pointers, which aren't the same between runs (malloc creates them different each time), and we may be trying to change the scenegraph storage - the subject of our tests. And not all things are stored in the scenegraph. But for some tests some kind of pointer-neutralized dump of the scenegraph might make a good test fixture.
>> .
> That's why given my limited knowledge of how it all works in the inside
> I'm shying away from that kind of testing.
> Because the whole thing seems daunting in size, my initial approach is a
> more conservative one where I prefer to think in small increments.
> If we rush into wanting to have 100% test coverage we might risk
> embarking in a never ending project on the side just for the testing.
>> So I think we would need general / flexible approach to testing to cover all cases. I kind of like what Michel had been attempting, saving the mouse coordinates for playback.
>> Perhaps what's needed is a playback file that records a lot of things, per post-parse frame#
>> playback[i] = {iframe, dtime, keystrokes or NULL, mouse (xy,button sequence) or NULL, snapshot URL or NULL, scenegraph_dump URL or NULL, ?other?}
> Having a format for a playback file that we could replay against the
> window is a good idea.
> Can you expand on what you mean by saving the mouse coordinates ?
.
Lets say you change the camera/avatar pose (translation xyz and orientation x y z angle) by moving the mouse, with a button down. There's a sequence of mouse (int x, int y, int button) that go into a mouse move function. One idea is to capture that sequence of tuples {(x,y,but),(x,y,but)...) for playback.
Most thing are done once per frame in freewrl. Except mouse and keyboard stuff, which comes in on the operating system window thread. So a change might be needed for Record mode, so instead of applying the sequence immediately, it queues it up, and applies it also once per frame. Then it will (I suspect) be more precisely repeatable during Playback mode.
.
>> .
>>> *This would obviously not cope well with moving objects in the scene but
>>> that's a different ball game.
>> .
>> Perhaps the above detailed playback file approach would/could be made to cover the moving objects scenario?
>> .
>>> What do you guys think about this ?
>>>
>>> I've pushed my test script to github and it lives in the branch called
>>> testing-freewrl.
>>> More details about it here
>>> https://github.com/pecastro/freewrl/commits/testing-freewrl
>>>
> The script is very basic and it's not really ready for consumption as it
> has some stuff hardcoded in it.
.
I'm on native win32, so the x-window and /usr environment stuff doesn't work for me.
I can run perl though - a .bat with:
"E:\Perl\bin\perl.exe" hudson.sh
pause
but just generic crossplatform stuff, as in the freex3d/codegen folder.
So I'm not sure where the boundary between perl and C could be, so that everyone can run.
.
|
|
From: doug s. <hig...@ho...> - 2013-05-18 14:08:04
|
>>>> - Currently the snapshot only seems to work with PNG which has a file is >>>> not suitable for comparison with for instance a previous master version. >>> . >>> Because of compression? Is there a way to turn off compression? If so then it switch on a global testing mode parameter. Or is there more saved, such as the date and timestamp in the .png, causing a generic binary file compare to fail? >>> (win32 saves .bmp which has no compression -great for testing- but it's a pain then emailing a screenshot because I have to use another tool to convert it to .png for cross-platform consumption) >>> Q. instead of saving to any standard file format, don't we first get a binary blob from opengl somehow, and could we just save the blob and use it for comparison? Perhaps store widthxheight in another file (playback file?) in case someone wants to visually check a failed comparison? Or would we always know the widthxheight by setting the opengl window to a standard size for testing? >> The PNG file format writes a timestamp in the end of the file. That's >> why I was thinking of a GIF. >> As for width x height that could be setup as a default convention, e.g. >> the default window size or the -big layout. >>> . . I'm looking at the Snapshot.c code now. It's a bit different for each platform. In C we switch on #define values Main desktop platforms: - OSX, AQUA - Apple desktop - WIN32, _MSC_VER - Microsoft Windows - (default) - Linux Mobile platforms: - _ANDROID - Google Android - IPHONE - Apple iPhone - QNX - Blackberry BB10, Playbook When I look in Snapshot.c the main ones are AQUA, _MSC_VER and (default linux). The linux section seems to write a simple .rgb format, then call a utility to convert it to .png /* convert -size 450x300 -depth 8 -flip /tmp/snappedfile.rgb out.png works. */ ... snprintf(sysline,sizeof(sysline),"%s -size %dx%d -depth 8 -flip %s %s", IMAGECONVERT,gglobal()->display.screenWidth, gglobal()->display.screenHeight,thisRawFile,thisGoodFile); . Lets assume for now that with a bit more C coding we'll be able to write out generic, uncompressed screen shots to named files on each main desktop platform, suitable for comparing between Recording and Playback. |
|
From: doug s. <hig...@ho...> - 2013-05-18 17:57:49
|
> I'm on native win32, so the x-window and /usr environment stuff doesn't work for me.
> I can run perl though - a .bat with:
> "E:\Perl\bin\perl.exe" hudson.sh
> pause
> but just generic crossplatform stuff, as in the freex3d/codegen folder.
> So I'm not sure where the boundary between perl and C could be, so that everyone can run.
> .
.
Paulo,
.
How about something like this:
1. Record
2. Playback
3. Compare
4. TestAll
.
In more detail:
1. Record - command line parameter for freewrl> saves .play and snapshots as you navigate and do things in the test scene
2. Playback - command line parameter for freewrl> reads .play, automatically runs and saves snapshots
3. Compare - perl script that compares Record vs Playback snapshots for a given test file
-- there might be several snapshots for a given test file run, named by the frame#
-- calls the platform file compare function
--- in ms windows its fc file1 file2
4. TestAll - perl script that runs through all test files, doing Playback and Compare, and reporting FAIL or SUCCESS to the user for each one run
.
-Doug
more...
.
Record mode
- command line flag puts it into a mode where it generates playback file and test fixtures
-- you do snapshots and address-neutralized scenegraph dumps and record frame and time
- playback file records:
-- playback[i] = {iframe, dtime, keystrokes or NULL, mouse (xy,button sequence) or NULL, snapshot URL or NULL, scenegraph_dump URL or NULL, ?other?}
- Option: one record per frame, so frame[i] = {dtime,keystrokes,mouse,snapshotURL,dumpscene_URL)
- Option: slow down frame rate intentionally to minimize noisy, empty playback records
- playback file naming> automatic: testfilename + R + .txt
- snapshot naming> automatic: testfilename + R / frame# || playback_index# + .rgb || .bmp
- dumpscene naming> automatic: testfilename + R / frame# || playback_index# + .dmp
.
Playback mode
Same as record mode except:
- instead of 'R' put 'P'
- instead of saving {frame#, dtime, keystrokes, mouse} they are read from the playback file
.
Compare
for each test scene
0. delete old scene Playback files and folder
1. run scene in playback mode and exit
2. file compare all the test fixture files in the testsceneR and testsceneP folders
.
Option: folder structure:
1.wrl (test scene)
1 / playback.play
1 / record / frame#.rgb, frame#.dump
1 / playback / frame#.rgb, frame#.dump
OR file naming pattern:
1.wrl
1.play
1_R / frame#.rgb, frame#.dump
1_P / frame#.rgb, frame#.dump
|
|
From: doug s. <hig...@ho...> - 2013-05-18 21:01:44
|
> 3. Compare - perl script that compares Record vs Playback snapshots for a given test file
> -- there might be several snapshots for a given test file run, named by the frame#
> -- calls the platform file compare function
> --- in ms windows its fc file1 file2
.
The perl I have on my windows XP has compare(f1,f2)
So this works with text and binary files:
#!/usr/bin/env perl
use File::Compare;
if (compare("file1.rgb","file2.rgb") == 0) {
print "They're equal\n";
}else{
print "They're different\n";
}
-Doug
more...
-IIRC I downloaded the Activestate perl from http://www.perl.org/get.html
|
|
From: doug s. <hig...@ho...> - 2013-05-18 22:37:48
|
>> 3. Compare - perl script that compares Record vs Playback snapshots for a given test file
>> -- there might be several snapshots for a given test file run, named by the frame#
>> -- calls the platform file compare function
>> --- in ms windows its fc file1 file2
> .
> The perl I have on my windows XP has compare(f1,f2)
> So this works with text and binary files:
> #!/usr/bin/env perl
> use File::Compare;
> if (compare("file1.rgb","file2.rgb") == 0) {
> print "They're equal\n";
> }else{
> print "They're different\n";
> }
> -Doug
> more...
> -IIRC I downloaded the Activestate perl from http://www.perl.org/get.html
.
2 screen snapshots of the same scene 1.wrl that _should_ be equal are different, and fc shows the differences spread out. (I hid the statusbar with its frames-per-second readout, by mousing over it, which brings up the menu bar). Hypotheses for the diff:
H0: something about my video board - a few bad pixels and I have the window in a different place
H1: floating point computations round differently depending how many frames have been rendered
H2: something in the .bmp header
If it's a small difference like 1/256 (1 bit out of a pixel's color value) perhaps a special compare function will be needed.
-Doug
|
|
From: doug s. <hig...@ho...> - 2013-05-19 13:49:28
|
>
>>> 3. Compare - perl script that compares Record vs Playback snapshots for a given test file
>>> -- there might be several snapshots for a given test file run, named by the frame#
>>> -- calls the platform file compare function
>>> --- in ms windows its fc file1 file2
>> .
>> The perl I have on my windows XP has compare(f1,f2)
>> So this works with text and binary files:
>> #!/usr/bin/env perl
>> use File::Compare;
>> if (compare("file1.rgb","file2.rgb") == 0) {
>> print "They're equal\n";
>> }else{
>> print "They're different\n";
>> }
>> -Doug
>> more...
>> -IIRC I downloaded the Activestate perl from http://www.perl.org/get.html
> .
> 2 screen snapshots of the same scene 1.wrl that _should_ be equal are different, and fc shows the differences spread out. (I hid the statusbar with its frames-per-second readout, by mousing over it, which brings up the menu bar). Hypotheses for the diff:
> H0: something about my video board - a few bad pixels and I have the window in a different place
> H1: floating point computations round differently depending how many frames have been rendered
> H2: something in the .bmp header
> If it's a small difference like 1/256 (1 bit out of a pixel's color value) perhaps a special compare function will be needed.
.
I downloaded GraphicsMagick from http://www.graphicsmagick.org (a forked & advanced project of ImageMagick) and ran the image compare function http://www.graphicsmagick.org/compare.html as follows on my 2 screen shots:
.
gm compare -metric mse freewrl_snapshot_A.bmp freewrl_snapshot_C.bmp
pause
gm compare freewrl_snapshot_A.bmp freewrl_snapshot_C.bmp -file diff.bmp -highlight-color purple -highlight-style Assign
gm convert diff.bmp win:
pause
.
The first compare shows a statistical summary:
Image Difference (MeanSquaredError):
Normalized Absolute
============ ==========
Red: 0.0000000000 0.0
Green: 0.0000000000 0.0
Blue: 0.0000010175 0.0
Total: 0.0000003392 0.0
.
The second compare generates an image with any different pixels colored purple. Here's the diff image converted to png and compressed - you'll see several purple pixels around the ! and checkmark icons on the menu bar:
http://dug9.users.sourceforge.net/web3d/diff.png
.
I had played with those two menu options during one of the runs. Hypothesis: it renders a bit different between original and post-activation on the menu bar.
.
Summary: looks like the main graphics window renders the same -no random floating point rounding differences in opengl- and differences are due to different user activity during one run, as seen by GraphicsMagic compare on uncompressed snapshots.
.
Conclusion: we should be able to do software testing based on snapshot differences.
-Doug
|
|
From: Luca C. <ce...@sy...> - 2013-05-20 16:21:46
|
Hi, I was working with the awesome X3D_get[type] and X3D_new[type] functions that make easy to translate values in and out the EAI channel when I've noticed what can be a bug. First of all, the X3D_freeNode function \src\libeai\EAI_C_Field.c -> line 38 works well for all the SF types, but it seems to me that does wrong the freeing of the MF types. In fact for almost all the MF types deallocates only the node->X3D_MFInt32.p pointer (line 73-82) , even if the struct allocates other types. The second problem lies in some X3D_new[type] functions that seem to allocate the wrong type. For instance X3D_newMFVec3f(int num, float(* array)[3]) \src\libeai\EAI_C_Field.c -> line 325 instead of allocating space for "n" _intX3D_SFVec3f and passing the address to the internal member X3D_MFVec3f.p allocates space for "n" X3DNode retval->X3D_MFVec3f.p = malloc (sizeof(X3DNode) * num); [line 332] I hope this could be useful. -- =============================================================== Luca Cerutti Profutura s.r.l. - Corso Tortona 17 - 10153 Torino phone: +39 (0)11 8392363 - fax: +39 (0)11 837802 e-mail: ce...@sy... http://www.synarea.com Le informazioni, i dati e le notizie contenute nella presente comunicazione e i relativi allegati sono di natura privata e come tali possono essere riservate e sono, comunque, destinate esclusivamente ai destinatari indicati in epigrafe. La diffusione, distribuzione e/o la copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p., sia ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di darcene immediata comunicazione anche inviando un messaggio di ritorno all’indirizzo e-mail del mittente. This e-mail (including attachments) is intended only for the recipient(s) named above. It may contain confidential or privileged information and should not be read, copied or otherwise used by any other person. If you are not the named recipient, please contact (ce...@sy...) and delete the e-mail from your system. Rif. D.L. 196/2003. =============================================================== |
|
From: doug s. <hig...@ho...> - 2013-05-20 23:28:47
|
>>
>>>> 3. Compare - perl script that compares Record vs Playback snapshots for a given test file
>>>> -- there might be several snapshots for a given test file run, named by the frame#
>>>> -- calls the platform file compare function
>>>> --- in ms windows its fc file1 file2
>>> .
>>> The perl I have on my windows XP has compare(f1,f2)
>>> So this works with text and binary files:
>>> #!/usr/bin/env perl
>>> use File::Compare;
>>> if (compare("file1.rgb","file2.rgb") == 0) {
>>> print "They're equal\n";
>>> }else{
>>> print "They're different\n";
>>> }
>>> -Doug
>>> more...
>>> -IIRC I downloaded the Activestate perl from http://www.perl.org/get.html
>> .
>> 2 screen snapshots of the same scene 1.wrl that _should_ be equal are different, and fc shows the differences spread out. (I hid the statusbar with its frames-per-second readout, by mousing over it, which brings up the menu bar). Hypotheses for the diff:
>> H0: something about my video board - a few bad pixels and I have the window in a different place
>> H1: floating point computations round differently depending how many frames have been rendered
>> H2: something in the .bmp header
>> If it's a small difference like 1/256 (1 bit out of a pixel's color value) perhaps a special compare function will be needed.
> .
> I downloaded GraphicsMagick from http://www.graphicsmagick.org (a forked & advanced project of ImageMagick) and ran the image compare function http://www.graphicsmagick.org/compare.html as follows on my 2 screen shots:
> .
> gm compare -metric mse freewrl_snapshot_A.bmp freewrl_snapshot_C.bmp
> pause
> gm compare freewrl_snapshot_A.bmp freewrl_snapshot_C.bmp -file diff.bmp -highlight-color purple -highlight-style Assign
> gm convert diff.bmp win:
> pause
> .
> The first compare shows a statistical summary:
> Image Difference (MeanSquaredError):
> Normalized Absolute
> ============ ==========
> Red: 0.0000000000 0.0
> Green: 0.0000000000 0.0
> Blue: 0.0000010175 0.0
> Total: 0.0000003392 0.0
> .
> The second compare generates an image with any different pixels colored purple. Here's the diff image converted to png and compressed - you'll see several purple pixels around the ! and checkmark icons on the menu bar:
> http://dug9.users.sourceforge.net/web3d/diff.png
> .
> I had played with those two menu options during one of the runs. Hypothesis: it renders a bit different between original and post-activation on the menu bar.
> .
> Summary: looks like the main graphics window renders the same -no random floating point rounding differences in opengl- and differences are due to different user activity during one run, as seen by GraphicsMagic compare on uncompressed snapshots.
> .
> Conclusion: we should be able to do software testing based on snapshot differences.
.
Paulo,
I retract that conclusion, based on further testing:
I put in -record and -playback commandline options (not checked in) that record the frame# (starting with 1 after scene loaded), dtime, keystrokes, mouse to a text playback file:
http://dug9.users.sourceforge.net/web3d/testing/playback.play
keystroke 'x' (command for saving a snapshot image) done at the same frame and dtime, and after the same mouse actions, was supposed to produce the same snapshot. Comparing with GraphicsMagic, I got this (compresssed png):
http://dug9.users.sourceforge.net/web3d/testing/diff_record_playback.png
showing the cone geometry speckled with dozens of different pixels.
.
Hypotheses:
H0: a small numerical difference of 1/256 due to floating point rounding in opengl or video board
Test: do a pixel compare channel by channel, to see the maximum difference
http://dug9.users.sourceforge.net/web3d/testing/freewrl_snapshot_record.bmp
http://dug9.users.sourceforge.net/web3d/testing/freewrl_snapshot_playback.bmp
If it's a 1/256 rounding error, then a special compare function could be used/developed that would forgive that small difference
H1: I didn't apply the mouse actions at the right point in the playback frame
H2: the floating point rounding is on the mouse coordinates (when converted to screen) and I don't have enough decimal places in the fprintf
H3: ???
.
I wonder if I should check it in, or forget it as hopeless, or do more tests.
-Doug
|
|
From: Luca C. <ce...@sy...> - 2013-05-21 10:29:18
|
Hi again, while going on with the C++ project I'm building, I've got some linker error. The cause was a multiple definition of: int EAIbufsize; char *EAIbuffer; That are defined in: d:\Sviluppo\INCA\Inca3D\I3DPlayer\freewrl\freewrl\freex3d\src\lib\iglobal.h as members of the struct: struct tEAICore (line 130) and in: d:\Sviluppo\INCA\Inca3D\I3DPlayer\freewrl\freewrl\freex3d\src\lib\input\EAIHeaders.h (line 200) as simple variables. I've tried to comment the declarations in EAIHeaders.h and rebuild all, without errors. I do not know if they are used in other projects (there is a reference to Java and plugin projects), nevertheless I feel that this redefinition is not correct, since in one case they are members of a crucial struct, and in the other they are simple variables. Also, given that iglobal.h is one of the main headers, it should be better to keep them only there. What do you think? Il 20/05/2013 18:09, Luca Cerutti ha scritto: > Hi, > I was working with the awesome X3D_get[type] and X3D_new[type] functions > that make easy to translate values in and out the EAI channel when I've > noticed what can be a bug. > > First of all, the X3D_freeNode function > \src\libeai\EAI_C_Field.c -> line 38 > > works well for all the SF types, but it seems to me that does wrong the > freeing of the MF types. In fact for almost all the MF types deallocates > only the > node->X3D_MFInt32.p pointer (line 73-82) , even if the struct allocates > other types. > > The second problem lies in some X3D_new[type] functions that seem to > allocate the wrong type. > For instance > X3D_newMFVec3f(int num, float(* array)[3]) > \src\libeai\EAI_C_Field.c -> line 325 > > instead of allocating space for "n" _intX3D_SFVec3f and passing the > address to the internal member X3D_MFVec3f.p allocates space for "n" X3DNode > retval->X3D_MFVec3f.p = malloc (sizeof(X3DNode) * num); [line 332] > > I hope this could be useful. > -- =============================================================== Luca Cerutti Profutura s.r.l. - Corso Tortona 17 - 10153 Torino phone: +39 (0)11 8392363 - fax: +39 (0)11 837802 e-mail: ce...@sy... http://www.synarea.com Le informazioni, i dati e le notizie contenute nella presente comunicazione e i relativi allegati sono di natura privata e come tali possono essere riservate e sono, comunque, destinate esclusivamente ai destinatari indicati in epigrafe. La diffusione, distribuzione e/o la copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p., sia ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di darcene immediata comunicazione anche inviando un messaggio di ritorno all’indirizzo e-mail del mittente. This e-mail (including attachments) is intended only for the recipient(s) named above. It may contain confidential or privileged information and should not be read, copied or otherwise used by any other person. If you are not the named recipient, please contact (ce...@sy...) and delete the e-mail from your system. Rif. D.L. 196/2003. =============================================================== |
|
From: doug s. <hig...@ho...> - 2013-05-21 12:19:06
|
> while going on with the C++ project I'm building, I've got some linker > error. > > The cause was a multiple definition of: > int EAIbufsize; > char *EAIbuffer; > > That are defined in: > d:\Sviluppo\INCA\Inca3D\I3DPlayer\freewrl\freewrl\freex3d\src\lib\iglobal.h > as members of the struct: > struct tEAICore (line 130) > and in: > d:\Sviluppo\INCA\Inca3D\I3DPlayer\freewrl\freewrl\freex3d\src\lib\input\EAIHeaders.h > (line 200) > as simple variables. > > I've tried to comment the declarations in EAIHeaders.h and rebuild all, > without errors. > I do not know if they are used in other projects (there is a reference > to Java and plugin projects), nevertheless I feel that this redefinition > is not correct, since in one case they are members of a crucial struct, > and in the other they are simple variables. > Also, given that iglobal.h is one of the main headers, it should be > better to keep them only there. > > What do you think? . Luca, I think it's OK to comment them out - go for it. -Doug more... A few years ago I moved all static variables into the global struct. But I could have missed removing a few after the move, especially if there were no compile errors. . > > Il 20/05/2013 18:09, Luca Cerutti ha scritto: >> Hi, >> I was working with the awesome X3D_get[type] and X3D_new[type] functions >> that make easy to translate values in and out the EAI channel when I've >> noticed what can be a bug. >> >> First of all, the X3D_freeNode function >> \src\libeai\EAI_C_Field.c -> line 38 >> >> works well for all the SF types, but it seems to me that does wrong the >> freeing of the MF types. In fact for almost all the MF types deallocates >> only the >> node->X3D_MFInt32.p pointer (line 73-82) , even if the struct allocates >> other types. >> >> The second problem lies in some X3D_new[type] functions that seem to >> allocate the wrong type. >> For instance >> X3D_newMFVec3f(int num, float(* array)[3]) >> \src\libeai\EAI_C_Field.c -> line 325 >> >> instead of allocating space for "n" _intX3D_SFVec3f and passing the >> address to the internal member X3D_MFVec3f.p allocates space for "n" X3DNode >> retval->X3D_MFVec3f.p = malloc (sizeof(X3DNode) * num); [line 332] >> >> I hope this could be useful. >> > > > -- > =============================================================== > Luca Cerutti > Profutura s.r.l. - Corso Tortona 17 - 10153 Torino > phone: +39 (0)11 8392363 - fax: +39 (0)11 837802 > e-mail: ce...@sy... > http://www.synarea.com > > Le informazioni, i dati e le notizie contenute nella presente comunicazione e i relativi allegati sono di natura privata e come tali possono essere riservate e sono, comunque, destinate esclusivamente ai destinatari indicati in epigrafe. La diffusione, distribuzione e/o la copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p., sia ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di darcene immediata comunicazione anche inviando un messaggio di ritorno all’indirizzo e-mail del mittente. > > This e-mail (including attachments) is intended only for the recipient(s) named above. It may contain confidential or privileged information and should not be read, copied or otherwise used by any other person. If you are not the named recipient, please contact (ce...@sy...) and delete the e-mail from your system. Rif. D.L. 196/2003. > =============================================================== > > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may > _______________________________________________ > FreeWRL-develop mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freewrl-develop |
|
From: doug s. <hig...@ho...> - 2013-05-21 12:46:45
|
>>>
>>>>> 3. Compare - perl script that compares Record vs Playback snapshots for a given test file
>>>>> -- there might be several snapshots for a given test file run, named by the frame#
>>>>> -- calls the platform file compare function
>>>>> --- in ms windows its fc file1 file2
>>>> .
>>>> The perl I have on my windows XP has compare(f1,f2)
>>>> So this works with text and binary files:
>>>> #!/usr/bin/env perl
>>>> use File::Compare;
>>>> if (compare("file1.rgb","file2.rgb") == 0) {
>>>> print "They're equal\n";
>>>> }else{
>>>> print "They're different\n";
>>>> }
>>>> -Doug
>>>> more...
>>>> -IIRC I downloaded the Activestate perl from http://www.perl.org/get.html
>>> .
>>> 2 screen snapshots of the same scene 1.wrl that _should_ be equal are different, and fc shows the differences spread out. (I hid the statusbar with its frames-per-second readout, by mousing over it, which brings up the menu bar). Hypotheses for the diff:
>>> H0: something about my video board - a few bad pixels and I have the window in a different place
>>> H1: floating point computations round differently depending how many frames have been rendered
>>> H2: something in the .bmp header
>>> If it's a small difference like 1/256 (1 bit out of a pixel's color value) perhaps a special compare function will be needed.
>> .
>> I downloaded GraphicsMagick from http://www.graphicsmagick.org (a forked & advanced project of ImageMagick) and ran the image compare function http://www.graphicsmagick.org/compare.html as follows on my 2 screen shots:
>> .
>> gm compare -metric mse freewrl_snapshot_A.bmp freewrl_snapshot_C.bmp
>> pause
>> gm compare freewrl_snapshot_A.bmp freewrl_snapshot_C.bmp -file diff.bmp -highlight-color purple -highlight-style Assign
>> gm convert diff.bmp win:
>> pause
>> .
>> The first compare shows a statistical summary:
>> Image Difference (MeanSquaredError):
>> Normalized Absolute
>> ============ ==========
>> Red: 0.0000000000 0.0
>> Green: 0.0000000000 0.0
>> Blue: 0.0000010175 0.0
>> Total: 0.0000003392 0.0
>> .
>> The second compare generates an image with any different pixels colored purple. Here's the diff image converted to png and compressed - you'll see several purple pixels around the ! and checkmark icons on the menu bar:
>> http://dug9.users.sourceforge.net/web3d/diff.png
>> .
>> I had played with those two menu options during one of the runs. Hypothesis: it renders a bit different between original and post-activation on the menu bar.
>> .
>> Summary: looks like the main graphics window renders the same -no random floating point rounding differences in opengl- and differences are due to different user activity during one run, as seen by GraphicsMagic compare on uncompressed snapshots.
>> .
>> Conclusion: we should be able to do software testing based on snapshot differences.
> .
> Paulo,
> I retract that conclusion, based on further testing:
> I put in -record and -playback commandline options (not checked in) that record the frame# (starting with 1 after scene loaded), dtime, keystrokes, mouse to a text playback file:
> http://dug9.users.sourceforge.net/web3d/testing/playback.play
> keystroke 'x' (command for saving a snapshot image) done at the same frame and dtime, and after the same mouse actions, was supposed to produce the same snapshot. Comparing with GraphicsMagic, I got this (compresssed png):
> http://dug9.users.sourceforge.net/web3d/testing/diff_record_playback.png
> showing the cone geometry speckled with dozens of different pixels.
> .
> Hypotheses:
> H0: a small numerical difference of 1/256 due to floating point rounding in opengl or video board
> Test: do a pixel compare channel by channel, to see the maximum difference
> http://dug9.users.sourceforge.net/web3d/testing/freewrl_snapshot_record.bmp
> http://dug9.users.sourceforge.net/web3d/testing/freewrl_snapshot_playback.bmp
> If it's a 1/256 rounding error, then a special compare function could be used/developed that would forgive that small difference
> H1: I didn't apply the mouse actions at the right point in the playback frame
> H2: the floating point rounding is on the mouse coordinates (when converted to screen) and I don't have enough decimal places in the fprintf
> H3: ???
> .
> I wonder if I should check it in, or forget it as hopeless, or do more tests.
.
If I run the -playback a second time, and compare the 2 playback images, there are zero differences. If I had implemented -record mode as a recording of mouse and keyboard, followed by a -playback to get the snapshot images, then I would see no differences between record and playback snapshots.
.
Summary: the way I implemented record and playback are not the same - a slightly different process or rounding, gives slightly different images. (for example the mouse coordinates are normalized to -1.0 to 1.0 floating point range, and in the record mode I use them directly, in playback they go through fprintf and sscanf which round them)
.
Conclusion: comparing record and playback images will work for functional testing, once implemented properly.
-Doug
|
|
From: doug s. <hig...@ho...> - 2013-05-21 13:16:32
|
>>>>
>>>>>> 3. Compare - perl script that compares Record vs Playback snapshots for a given test file
>>>>>> -- there might be several snapshots for a given test file run, named by the frame#
>>>>>> -- calls the platform file compare function
>>>>>> --- in ms windows its fc file1 file2
>>>>> .
>>>>> The perl I have on my windows XP has compare(f1,f2)
>>>>> So this works with text and binary files:
>>>>> #!/usr/bin/env perl
>>>>> use File::Compare;
>>>>> if (compare("file1.rgb","file2.rgb") == 0) {
>>>>> print "They're equal\n";
>>>>> }else{
>>>>> print "They're different\n";
>>>>> }
>>>>> -Doug
>>>>> more...
>>>>> -IIRC I downloaded the Activestate perl from http://www.perl.org/get.html
>>>> .
>>>> 2 screen snapshots of the same scene 1.wrl that _should_ be equal are different, and fc shows the differences spread out. (I hid the statusbar with its frames-per-second readout, by mousing over it, which brings up the menu bar). Hypotheses for the diff:
>>>> H0: something about my video board - a few bad pixels and I have the window in a different place
>>>> H1: floating point computations round differently depending how many frames have been rendered
>>>> H2: something in the .bmp header
>>>> If it's a small difference like 1/256 (1 bit out of a pixel's color value) perhaps a special compare function will be needed.
>>> .
>>> I downloaded GraphicsMagick from http://www.graphicsmagick.org (a forked & advanced project of ImageMagick) and ran the image compare function http://www.graphicsmagick.org/compare.html as follows on my 2 screen shots:
>>> .
>>> gm compare -metric mse freewrl_snapshot_A.bmp freewrl_snapshot_C.bmp
>>> pause
>>> gm compare freewrl_snapshot_A.bmp freewrl_snapshot_C.bmp -file diff.bmp -highlight-color purple -highlight-style Assign
>>> gm convert diff.bmp win:
>>> pause
>>> .
>>> The first compare shows a statistical summary:
>>> Image Difference (MeanSquaredError):
>>> Normalized Absolute
>>> ============ ==========
>>> Red: 0.0000000000 0.0
>>> Green: 0.0000000000 0.0
>>> Blue: 0.0000010175 0.0
>>> Total: 0.0000003392 0.0
>>> .
>>> The second compare generates an image with any different pixels colored purple. Here's the diff image converted to png and compressed - you'll see several purple pixels around the ! and checkmark icons on the menu bar:
>>> http://dug9.users.sourceforge.net/web3d/diff.png
>>> .
>>> I had played with those two menu options during one of the runs. Hypothesis: it renders a bit different between original and post-activation on the menu bar.
>>> .
>>> Summary: looks like the main graphics window renders the same -no random floating point rounding differences in opengl- and differences are due to different user activity during one run, as seen by GraphicsMagic compare on uncompressed snapshots.
>>> .
>>> Conclusion: we should be able to do software testing based on snapshot differences.
>> .
>> Paulo,
>> I retract that conclusion, based on further testing:
>> I put in -record and -playback commandline options (not checked in) that record the frame# (starting with 1 after scene loaded), dtime, keystrokes, mouse to a text playback file:
>> http://dug9.users.sourceforge.net/web3d/testing/playback.play
>> keystroke 'x' (command for saving a snapshot image) done at the same frame and dtime, and after the same mouse actions, was supposed to produce the same snapshot. Comparing with GraphicsMagic, I got this (compresssed png):
>> http://dug9.users.sourceforge.net/web3d/testing/diff_record_playback.png
>> showing the cone geometry speckled with dozens of different pixels.
>> .
>> Hypotheses:
>> H0: a small numerical difference of 1/256 due to floating point rounding in opengl or video board
>> Test: do a pixel compare channel by channel, to see the maximum difference
>> http://dug9.users.sourceforge.net/web3d/testing/freewrl_snapshot_record.bmp
>> http://dug9.users.sourceforge.net/web3d/testing/freewrl_snapshot_playback.bmp
>> If it's a 1/256 rounding error, then a special compare function could be used/developed that would forgive that small difference
>> H1: I didn't apply the mouse actions at the right point in the playback frame
>> H2: the floating point rounding is on the mouse coordinates (when converted to screen) and I don't have enough decimal places in the fprintf
>> H3: ???
>> .
>> I wonder if I should check it in, or forget it as hopeless, or do more tests.
> .
> If I run the -playback a second time, and compare the 2 playback images, there are zero differences. If I had implemented -record mode as a recording of mouse and keyboard, followed by a -playback to get the snapshot images, then I would see no differences between record and playback snapshots.
> .
> Summary: the way I implemented record and playback are not the same - a slightly different process or rounding, gives slightly different images. (for example the mouse coordinates are normalized to -1.0 to 1.0 floating point range, and in the record mode I use them directly, in playback they go through fprintf and sscanf which round them)
> .
> Conclusion: comparing record and playback images will work for functional testing, once implemented properly.
>
.
Confirmed. Using the same rounded mouse x,y during record as playback, there are no differences now between the record snapshot and the playback snapshot.
.
I'll do a little more testing, and work on naming of the playback and (uncompressed) snapshot files before checking it in.
-Doug
|
|
From: doug s. <hig...@ho...> - 2013-05-23 18:46:53
|
> >> I'm on native win32, so the x-window and /usr environment stuff doesn't work for me. >> I can run perl though - a .bat with: >> "E:\Perl\bin\perl.exe" hudson.sh >> pause >> but just generic crossplatform stuff, as in the freex3d/codegen folder. >> So I'm not sure where the boundary between perl and C could be, so that everyone can run. >> . > . > How about something like this: > 1. Record > 2. Playback > 3. Compare > 4. TestAll > . . Paulo, I implemented and checked in 3 new command line options: -R (or --record) - records to a .fwplay ASCII file, with frame#,dtime,keystrokes,mouseActions -F (or --fixture) - plays back the .fwplay file, and saves snapshots with a 'fixture' name -P (or --playback) -plays back the .fwplay file, and saves snapshots with a 'playback' name . -R and -F can be combined on the command line to save a step: generate .fwplay and fixture snapshots during the same run . In the code I have 3 ways to save the files, and have it set at 1 (folder method) //0=default: recording.fwplay, fixture.bmp playback.bmp - will overwrite for each scene //1=folders: 1_wrl/recording.fwplay, 1_wrl/fixture/17.bmp, 1_wrl/playback/17.bmp //2=flattened: 1_wrl.fwplay, 1_wrl_fixture_17.bmp, 1_wrl_playback_17.bmp (17 is frame#) namingMethod = 1; I don't know if the folder method works on linux - it uses a mkdir() method which is slightly different than windows, so I abstracted with an fw_mkdir() function and a #ifdef. . I didn't do any work on the snapshot file type for linux - I think it will save to a .snap file? - someone on linux will need to fix this, for example if you want .rgb snapshot files. . I've only run compare on a few sample snapshot files - works so far. I haven't done the statusbarHud menubar mouse coordinate save and replay yet, so I don't know if there are problems there. . Q. what's best of the fwplay and snapshot naming methods: default, folders or flattened, OR should it be a commandline option, and if so with which method as default? . -Doug |
|
From: doug s. <hig...@ho...> - 2013-05-25 21:11:20
|
>> How about something like this: >> 1. Record >> 2. Playback >> 3. Compare >> 4. TestAll - perl >> . > I implemented and checked in 3 new command line options: > -R (or --record) - records to a .fwplay ASCII file, with frame#,dtime,keystrokes,mouseActions > -F (or --fixture) - plays back the .fwplay file, and saves snapshots with a 'fixture' name > -P (or --playback) -plays back the .fwplay file, and saves snapshots with a 'playback' name > . > -R and -F can be combined on the command line to save a step: generate .fwplay and fixture snapshots during the same run > . > In the code I have 3 ways to save the files, and have it set at 1 (folder method) > //0=default: recording.fwplay, fixture.bmp playback.bmp - will overwrite for each scene > //1=folders: 1_wrl/recording.fwplay, 1_wrl/fixture/17.bmp, 1_wrl/playback/17.bmp > //2=flattened: 1_wrl.fwplay, 1_wrl_fixture_17.bmp, 1_wrl_playback_17.bmp (17 is frame#) . I added an additional file naming method and made it default: //3=groupfolders: /tests, /recordings/*.fwplay, /fixtures/1_wrl_17.bmp /playbacks/1_wrl_17.bmp namingMethod = 3; With this method, to send the tests to someone on a different system you'd zip the /recordings folder and send just that (assuming they have all the test/*.wrl). To clean out a previous testAll run you'd remove the /playback folder. . > I don't know if the folder method works on linux - it uses a mkdir() method which is slightly different than windows, so I abstracted with an fw_mkdir() function and a #ifdef. > . > I didn't do any work on the snapshot file type for linux - I think it will save to a .snap file? - someone on linux will need to fix this, for example if you want .rgb snapshot files. > . > I've only run compare on a few sample snapshot files - works so far. > I haven't done the statusbarHud menubar mouse coordinate save and replay yet, so I don't know if there are problems there. > . . I changed to integer mouse coordinates, intercepted earlier so they apply to statusbarHud as well as navigation, clicking and picking. . To do this I changed the linux mouse/keyboard handling code and did not verify it on a linux system ** please verify** . -Doug |
|
From: doug s. <hig...@ho...> - 2013-05-26 18:31:53
|
I'm running ubuntu 12.04 LTS (the latest long-term-stable) on an old pentium, with nVidia graphics card I cvs checkout freewrl, I configure, make, make install. I hard link libmozjs.so. I run. I get: """ Xlib: extension "GLX" missing on display ":0.0". FreeWRL can not find an appropriate visual from GLX initFreeWRL: error in display initialization. fwl_startFreeWRL called """ No window pops up. Q. is it hopeless - a hardware issue - or is there something I could look at? -Doug |
|
From: Ian S. A. R. <ia...@ae...> - 2013-05-26 18:38:40
|
nah. it's a bad driver or wrongly configured xorg or missing lib. use glxinfo to debug. email me offlist or jump into any Linux support channel on irc (free node) and you can get this sorted easily. Sent from my iPhone On 2013-05-26, at 2:31 PM, doug sanden <hig...@ho...> wrote: > I'm running ubuntu 12.04 LTS (the latest long-term-stable) on an old pentium, with nVidia graphics card > I cvs checkout freewrl, I configure, make, make install. > I hard link libmozjs.so. I run. I get: """ > Xlib: extension "GLX" missing on display ":0.0". > FreeWRL can not find an appropriate visual from GLX > initFreeWRL: error in display initialization. > fwl_startFreeWRL called > """ > No window pops up. > Q. is it hopeless - a hardware issue - or is there something I could look at? > -Doug > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may > _______________________________________________ > FreeWRL-develop mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freewrl-develop > |
|
From: doug s. <hig...@ho...> - 2013-05-27 12:48:46
|
> > nah. it's a bad driver or wrongly configured xorg or missing lib. use glxinfo to debug. > Ian - thanks for the encouragement - I kept going and found a good page that said "run the Additional Drivers program" which had a recommendation selected and all I had to do was press the "Activate" button, enter su password, wait 5 minutes while it downloaded and installed, then it said to reboot and now I can get freewrl 1.wrl showing a cone. https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia -Doug > >> >> I'm running ubuntu 12.04 LTS (the latest long-term-stable) on an old pentium, with nVidia graphics card >> I cvs checkout freewrl, I configure, make, make install. >> I hard link libmozjs.so. I run. I get: """ >> Xlib: extension "GLX" missing on display ":0.0". >> FreeWRL can not find an appropriate visual from GLX >> initFreeWRL: error in display initialization. >> fwl_startFreeWRL called >> """ >> No window pops up. >> Q. is it hopeless - a hardware issue - or is there something I could look at? |
|
From: doug s. <hig...@ho...> - 2013-05-27 13:22:03
|
>>> >>> I'm running ubuntu 12.04 LTS (the latest long-term-stable) on an old pentium, with nVidia graphics card >>> I cvs checkout freewrl, I configure, make, make install. >>> I hard link libmozjs.so. I run. It reports my opengl is 1.5.8 (not enough for GLES2 I gather, which IIRC is about 2.1 or 2.2) When I run: freewrl -R I get: freewrl: symbol lookup error: freewrl: undefined symbol: fwl_set_modeRecord That function is one I added recently, and it's working on win32. Mainloop.c L.3649 libFreeWRL.h L.244 options.c L.414 Any hypotheses? -Doug |
|
From: Ian S. A. <ia...@ae...> - 2013-05-27 13:24:56
|
On 27/05/13 09:21 AM, doug sanden wrote: >>>> >>>> I'm running ubuntu 12.04 LTS (the latest long-term-stable) on an old pentium, with nVidia graphics card >>>> I cvs checkout freewrl, I configure, make, make install. >>>> I hard link libmozjs.so. I run. > It reports my opengl is 1.5.8 (not enough for GLES2 I gather, which IIRC is about 2.1 or 2.2) > When I run: > freewrl -R > I get: > freewrl: symbol lookup error: freewrl: undefined symbol: fwl_set_modeRecord > That function is one I added recently, and it's working on win32. > Mainloop.c L.3649 > libFreeWRL.h L.244 > options.c L.414 > Any hypotheses? > -Doug Probably the new header or source file(s) needs to be added to the Makefile.sources in /src/lib |
|
From: Paulo E. C. <pau...@gm...> - 2013-05-27 13:34:37
|
On 27/05/13 14:24, Ian Stakenvicius, Aerobiology wrote: >> It reports my opengl is 1.5.8 (not enough for GLES2 I gather, which IIRC is about 2.1 or 2.2) >> >When I run: >> >freewrl -R >> >I get: >> >freewrl: symbol lookup error: freewrl: undefined symbol: fwl_set_modeRecord >> >That function is one I added recently, and it's working on win32. >> >Mainloop.c L.3649 >> >libFreeWRL.h L.244 >> >options.c L.414 >> >Any hypotheses? >> >-Doug > Probably the new header or source file(s) needs to be added to the > Makefile.sources in /src/lib > I can run it fine from the recent trunk... |
|
From: Paulo E. C. <pau...@gm...> - 2013-05-27 13:39:37
|
On 26/05/13 19:31, doug sanden wrote: > I'm running ubuntu 12.04 LTS (the latest long-term-stable) on an old pentium, with nVidia graphics card > I cvs checkout freewrl, I configure, make, make install. > I hard link libmozjs.so. I run. I get: """ > Xlib: extension "GLX" missing on display ":0.0". > FreeWRL can not find an appropriate visual from GLX > initFreeWRL: error in display initialization. > fwl_startFreeWRL called > """ > No window pops up. > Q. is it hopeless - a hardware issue - or is there something I could look at? > -Doug > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may > _______________________________________________ > FreeWRL-develop mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freewrl-develop > . > I noticed you had to patch trunk so you could build FreeWRL. I also noticed that some of the fixes you applied where very similar to the ones I had submitted as patches a while ago... Anyway... Thanks for that. Still, if we enable eai for a linux build it still fails, I think it requires this patch. commit 20ceb3732218fc2406dda658ad1a12faf564f6c1 Author: Paulo E. Castro <pau...@gm...> Date: Sat Apr 20 01:24:25 2013 +0100 make it build 2 diff --git a/freex3d/src/libeai/EAI_C_Control.c b/freex3d/src/libeai/EAI_C_Control.c index 7a06f7b..40ccb94 100644 --- a/freex3d/src/libeai/EAI_C_Control.c +++ b/freex3d/src/libeai/EAI_C_Control.c @@ -35,8 +35,8 @@ void X3D_initialize(char *hostname) { struct sockaddr_in serv_addr; struct hostent *server; int iret1; - #ifdef WIN32 int iret2; + #ifdef WIN32 WORD wVersionRequested; WSADATA wsaData; int err; Otherwise iret2 will be hidden within the WIN32 directive. |