[K/N][Runtime tests] Support << operator for thread states

This commit is contained in:
Ilya Matveev
2021-06-07 19:21:53 +07:00
committed by Space
parent 7ed22360f9
commit f08d473d3c
2 changed files with 11 additions and 0 deletions
@@ -11,6 +11,7 @@
#include "GlobalsRegistry.hpp"
#include "TestSupport.hpp"
#include "ThreadData.hpp"
#include "ThreadState.hpp"
using namespace kotlin;
@@ -57,4 +58,8 @@ extern "C" void Kotlin_TestSupport_AssertClearGlobalState() {
void kotlin::DeinitMemoryForTests(MemoryState* memoryState) {
DeinitMemory(memoryState, false);
mm::ThreadRegistry::TestSupport::ClearCurrentThreadData();
}
std::ostream& kotlin::operator<<(std::ostream& stream, ThreadState state) {
return stream << ThreadStateName(state);
}
@@ -5,6 +5,8 @@
#include "../../main/cpp/TestSupport.hpp"
#include <ostream>
#include "MemoryPrivate.hpp"
#include "ThreadData.hpp"
@@ -16,4 +18,8 @@ inline void RunInNewThread(std::function<void(mm::ThreadData&)> f) {
});
}
// Overload the << operator for ThreadState to allow the GTest runner
// to pretty print ThreadState constants.
std::ostream& operator<<(std::ostream& stream, ThreadState state);
} // namespace kotlin