Unit testing methods in custom gamestate class.
I have a custom class (ALevelGameState) that is a child of AGameState. I've added a couple methods and one property for tracking player points and I'd like to run unit tests on them using the automation tab in session frontend (or anyway to run unit tests...). I've setup the simple test using IMPLEMENT_SIMPLE_AUTOMATION_TEST like in the automation tech guide. However anytime I try to create an ALevelGameState object and call my getScore() method, using something like I did in my custom gamemode class, I get read reference errors at runtime. Is there a special setup or dependencies I also need to create in order to unit test my custom gamestate? I noticed that AGameMode calls: GameState = GetWorld()->SpawnActor(GameStateClass, SpawnInfo);. Do I have to launch a game and a map in order to test with gamestate, or any actor related class?
This may also be due to my limited C++ knowledge instead of something UE specific. So I'm not sure which topic to search.
asked Dec 16 '14 at 06:13 PM in C++ Programming
Are you passing in ATF_Game to IMPLEMENT_SIMPLE_AUTOMATION_TEST()? I don't think those show up in Session FrontEnd. You can try changing it to ATF_Editor if your unit tests don't need GEngine
answered Dec 17 '14 at 09:58 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here