Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 94 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 550 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 550 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined variable $awaitingusers - Line: 26 - File: global.php(872) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/global.php(872) : eval()'d code 26 errorHandler->error
/global.php 872 eval
/showthread.php 28 require_once
Warning [2] Undefined array key 1 - Line: 1449 - File: inc/functions.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions.php 1449 errorHandler->error
/inc/functions.php 1414 fetch_forum_permissions
/inc/functions.php 2953 forum_permissions
/showthread.php 657 build_forum_jump
Warning [2] Undefined array key "mybb" - Line: 1997 - File: inc/functions.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions.php 1997 errorHandler->error
/inc/functions_indicators.php 41 my_set_array_cookie
/showthread.php 665 mark_thread_read
Warning [2] Undefined array key "additionalgroups" - Line: 7360 - File: inc/functions.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions.php 7360 errorHandler->error
/inc/functions_user.php 813 is_member
/inc/functions_post.php 416 purgespammer_show
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "showimages" - Line: 757 - File: inc/functions_post.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php 757 errorHandler->error
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 762 - File: inc/functions_post.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php 762 errorHandler->error
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "additionalgroups" - Line: 7360 - File: inc/functions.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions.php 7360 errorHandler->error
/inc/functions_user.php 813 is_member
/inc/functions_post.php 416 purgespammer_show
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "showimages" - Line: 757 - File: inc/functions_post.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php 757 errorHandler->error
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 762 - File: inc/functions_post.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php 762 errorHandler->error
/showthread.php 1114 build_postbit
Warning [2] Undefined variable $threadnotesbox - Line: 33 - File: showthread.php(1587) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/showthread.php(1587) : eval()'d code 33 errorHandler->error
/showthread.php 1587 eval
Warning [2] Undefined variable $ratethread - Line: 41 - File: showthread.php(1587) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/showthread.php(1587) : eval()'d code 41 errorHandler->error
/showthread.php 1587 eval
Warning [2] Undefined variable $addremovesubscription - Line: 82 - File: showthread.php(1587) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/showthread.php(1587) : eval()'d code 82 errorHandler->error
/showthread.php 1587 eval
Warning [2] Undefined variable $usersbrowsing - Line: 92 - File: showthread.php(1587) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/showthread.php(1587) : eval()'d code 92 errorHandler->error
/showthread.php 1587 eval
Warning [2] Undefined variable $thread_deleted - Line: 107 - File: showthread.php(1587) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/showthread.php(1587) : eval()'d code 107 errorHandler->error
/showthread.php 1587 eval

Unit Testing with MURL
The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 94 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 550 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 550 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined variable $awaitingusers - Line: 26 - File: global.php(872) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/global.php(872) : eval()'d code 26 errorHandler->error
/global.php 872 eval
/showthread.php 28 require_once
Warning [2] Undefined array key 1 - Line: 1449 - File: inc/functions.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions.php 1449 errorHandler->error
/inc/functions.php 1414 fetch_forum_permissions
/inc/functions.php 2953 forum_permissions
/showthread.php 657 build_forum_jump
Warning [2] Undefined array key "mybb" - Line: 1997 - File: inc/functions.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions.php 1997 errorHandler->error
/inc/functions_indicators.php 41 my_set_array_cookie
/showthread.php 665 mark_thread_read
Warning [2] Undefined array key "additionalgroups" - Line: 7360 - File: inc/functions.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions.php 7360 errorHandler->error
/inc/functions_user.php 813 is_member
/inc/functions_post.php 416 purgespammer_show
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "showimages" - Line: 757 - File: inc/functions_post.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php 757 errorHandler->error
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 762 - File: inc/functions_post.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php 762 errorHandler->error
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "additionalgroups" - Line: 7360 - File: inc/functions.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions.php 7360 errorHandler->error
/inc/functions_user.php 813 is_member
/inc/functions_post.php 416 purgespammer_show
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "showimages" - Line: 757 - File: inc/functions_post.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php 757 errorHandler->error
/showthread.php 1114 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 762 - File: inc/functions_post.php PHP 8.1.27 (FreeBSD)
File Line Function
/inc/functions_post.php 762 errorHandler->error
/showthread.php 1114 build_postbit
Warning [2] Undefined variable $threadnotesbox - Line: 33 - File: showthread.php(1587) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/showthread.php(1587) : eval()'d code 33 errorHandler->error
/showthread.php 1587 eval
Warning [2] Undefined variable $ratethread - Line: 41 - File: showthread.php(1587) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/showthread.php(1587) : eval()'d code 41 errorHandler->error
/showthread.php 1587 eval
Warning [2] Undefined variable $addremovesubscription - Line: 82 - File: showthread.php(1587) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/showthread.php(1587) : eval()'d code 82 errorHandler->error
/showthread.php 1587 eval
Warning [2] Undefined variable $usersbrowsing - Line: 92 - File: showthread.php(1587) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/showthread.php(1587) : eval()'d code 92 errorHandler->error
/showthread.php 1587 eval
Warning [2] Undefined variable $thread_deleted - Line: 107 - File: showthread.php(1587) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/showthread.php(1587) : eval()'d code 107 errorHandler->error
/showthread.php 1587 eval






Unit Testing with MURL
#1
Apost 
Hey there Smile

I am using CppUnit to perform unit testing in my projects. Though everything is quite straight forward most of the time, unit testing gets difficult or better say more complicated when it comes to classes that are initialized over xml.

Examples for this would be a classes inheriting from Logic::GraphPositionInstance or classes containing/being custom nodes (e.g. http://murlengine.com/forum/showthread.php?tid=36 ).

Another problem arises when I want to test methods that modify the UI in some way.

So far I helped myself by creating custom constructors to be used in test cases and initializing only the most necessary stuff in order for the tests to work.

When it comes to methods manipulating the UI, I used preprocessor commands to disable UI interactions.
Example:
void ToggleButton::OnSetToInactive()
{
    Notify(Button::GetButtonId(), ToggleButton::Messages::SET_TO_INACTIVE);
#ifdef DRAW_GUI_ACTION
    TextTextureNode->SetBackgroundColor(Color(133.0f, 133.0f, 133.0f, 0.0f));
    ButtonNode->SetEnabled(false);
#endif
}

So much for explaining my approach...
Now to my questions.
  1. Is this is the correct/optimal way to perform unit testing with MURL?
  2. Would it be possible to also include methods that manipulate UI components into testing (e.g. SetBackgroundColor)?
  3. Are there any best practices or "dos and don'ts" you came across during your development?
As always, thank you!
Reply
#2
Apost 
[Image: 02-MultiMedical-1500x1500-1.png]
Reply


Forum Jump:


Copyright © 2011-2024 Spraylight GmbH.