x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: Not Selected
Tags:
more ▼

asked Dec 16 '14 at 06:13 PM in C++ Programming

avatar image

Hexerei
56 3 5 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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

more ▼

answered Dec 17 '14 at 09:58 PM

avatar image

jcoombs
91 5 8 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question