• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

How to set up a test environment

Phil7

Moderator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
886
My project is getting bigger an sometimes bug are tricky to find, so I am thinking about how to test classes and functions in a more isolated way.
Until now I only had some constants to skip waiting times or some parts of the game and enabling sets of constants with preprocessor directives:
Cerberus:
#Print "************"+AppType +GLFW_GCC_MSIZE_WINNT +"Bit_Build*********"

#if CONFIG="debug"
    #Test=True
#EndIf

#Premium=False
#SlowDesktop=True
    
'Global Settings
Const SCR_WIDTH:Float = 1920
Const SCR_HEIGHT:Float = 1080

Const MUSIC_ON:Bool = False



#If Test
    Const GAME_ENABLED:Bool = False
            
    #If Premium
        #Print "Test Premium Version"
        Const MAX_USER_CNT:Int = 20
    #Else
        #Print "Test Standard Version"
        Const MAX_USER_CNT:Int = 5
    #Endif
        
    Const SAVESTATE_INTERVALL:Float = 6000.0
        
    
#Else
    Const GAME_ENABLED:Bool = True
    
    #If Premium
    #Print "Final Premium Version"
    Const MAX_USER_CNT:Int = 20
    #Else
    #Print "Final Standard Version"
    Const MAX_USER_CNT:Int = 5
    #Endif
        
    Const SAVESTATE_INTERVALL:Float = 60.0
    
#Endif

But how would you test single classes or groups of them?
I am also interested in how you go about it or how it should be done properly.
 
The only thing i do is using reflection on my whole project to find syntax errors in my code that is currently not called.
 
Do you have a small example , how you do that?
 
@Phil7 here you go. In my fantomCX framework, I (un)comment the following lines when I add new features. Just so everything is added to the build and trans will detect errors in code, that is currently not called and would not be included in a build. Either for a single module like below, our the whole framework.

Cerberus:
Import reflection
#REFLECTION_FILTER+="|fantomCX.cftView"
'#REFLECTION_FILTER+="|fantomCX*"
 
Thanks a lot! Maybe I need this amount of testing stuff, because my coding is not very clean, I did a lot of restructuring while getting experience and I often have bugs in it, that are hard to find for me. :oops:
 
I guessed something like that. Every intervention is just a piece in the puzzle of a working code, right?

I am going to open another thread for some related questions about suitable code structure.
 
Back
Top Bottom