Working on unit tests for class world

This commit is contained in:
2021-08-03 11:25:12 -04:00
parent 91d7e1c15d
commit 202c5a24ba
13 changed files with 240 additions and 103 deletions

View File

@@ -182,8 +182,10 @@ public:
void add(int64_t id, const AnimStep &step);
// Serialize or deserialize to a StreamBuffer
void serialize_size_and_steps(StreamBuffer *sb) const;
void deserialize_size_and_steps(StreamBuffer *sb);
//
// Caution: version numbers are not stored. On deserialize,
// version number is set to zero.
//
void serialize(StreamBuffer *sb) const;
void deserialize(StreamBuffer *sb);
@@ -196,11 +198,21 @@ public:
// Get the final resting place after all animations are complete.
const AnimStep &back() const;
// (For testing): change the size limit.
public:
////////////////////////////////////////////////////////////////////////////
//
// TESTING SUPPORT
//
// The following functions are not designed to be useful for production
// code, they're designed to be helpful for unit testing.
//
////////////////////////////////////////////////////////////////////////////
// Change the size limit.
void full_clear_and_set_limit(int szl);
void set_limit(int szl);
// (For testing): make sure the invariants are preserved.
// Make sure the invariants are preserved.
bool valid() const;
// Convert to a string for debugging purposes.