[Runtime testing] Get rid of THROW_NOT_IMPLEMENTED macro

This commit is contained in:
Ilya Matveev
2020-10-13 14:16:00 +07:00
committed by Ilya Matveev
parent 6ed7819773
commit c2d05acf71
3 changed files with 33 additions and 46 deletions
@@ -3,7 +3,6 @@
* that can be found in the LICENSE file.
*/
#include "CompilerGenerated.h"
#include "Types.h"
namespace {
@@ -70,15 +69,15 @@ OBJ_GETTER0(TheEmptyString) {
}
RUNTIME_NORETURN OBJ_GETTER(makeWeakReferenceCounter, void*) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
RUNTIME_NORETURN OBJ_GETTER(makePermanentWeakReferenceImpl, void*) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
RUNTIME_NORETURN OBJ_GETTER(makeObjCWeakReferenceImpl, void*) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void checkRangeIndexes(KInt from, KInt to, KInt size) {
@@ -93,67 +92,67 @@ void checkRangeIndexes(KInt from, KInt to, KInt size) {
}
RUNTIME_NORETURN OBJ_GETTER(WorkerLaunchpad, KRef) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowWorkerInvalidState() {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowNullPointerException() {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowArrayIndexOutOfBoundsException() {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowClassCastException(const ObjHeader* instance, const TypeInfo* type_info) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowArithmeticException() {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowNumberFormatException() {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowOutOfMemoryError() {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowNotImplementedError() {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowCharacterCodingException() {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowIllegalArgumentException() {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowIllegalStateException() {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowInvalidMutabilityException(KConstRef where) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowIncorrectDereferenceException() {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowIllegalObjectSharingException(KConstNativePtr typeInfo, KConstNativePtr address) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void RUNTIME_NORETURN ThrowFreezingException(KRef toFreeze, KRef blocker) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void ReportUnhandledException(KRef throwable) {
@@ -161,15 +160,15 @@ void ReportUnhandledException(KRef throwable) {
}
RUNTIME_NORETURN OBJ_GETTER(DescribeObjectForDebugging, KConstNativePtr typeInfo, KConstNativePtr address) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void ExceptionReporterLaunchpad(KRef reporter, KRef throwable) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void Kotlin_WorkerBoundReference_freezeHook(KRef thiz) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
extern const KBoolean BOOLEAN_RANGE_FROM = false;
@@ -228,7 +227,7 @@ extern KBox<KLong> LONG_CACHE[] = {
};
RUNTIME_NORETURN OBJ_GETTER(Kotlin_Throwable_getMessage, KRef throwable) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
} // extern "C"
@@ -1,11 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
#ifndef RUNTIME_COMPILER_GENERATED_H
#define RUNTIME_COMPILER_GENERATED_H
#define THROW_NOT_IMPLEMENTED throw std::runtime_error("Not implemented for tests");
#endif //RUNTIME_COMPILER_GENERATED_H
@@ -8,7 +8,6 @@
#include <Foundation/NSObject.h>
#include <objc/runtime.h>
#include "CompilerGenerated.h"
#include "Types.h"
extern "C" {
@@ -23,27 +22,27 @@ Class Kotlin_Interop_getObjCClass(const char* name) {
}
RUNTIME_NORETURN OBJ_GETTER0(Kotlin_NSEnumeratorAsKIterator_create) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void Kotlin_NSEnumeratorAsKIterator_done(KRef thiz) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void Kotlin_NSEnumeratorAsKIterator_setNext(KRef thiz, KRef value) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
RUNTIME_NORETURN OBJ_GETTER(Kotlin_ObjCExport_NSErrorAsExceptionImpl, KRef message, KRef error) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void Kotlin_ObjCExport_ThrowCollectionConcurrentModification() {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void Kotlin_ObjCExport_ThrowCollectionTooLarge() {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
typedef OBJ_GETTER((*convertReferenceFromObjC), id obj);
@@ -51,19 +50,19 @@ extern convertReferenceFromObjC Kotlin_ObjCExport_blockToFunctionConverters[] =
extern int Kotlin_ObjCExport_blockToFunctionConverters_size = 0;
RUNTIME_NORETURN OBJ_GETTER(Kotlin_ObjCExport_createContinuationArgumentImpl, KRef completionHolder, const TypeInfo** exceptionTypes) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
RUNTIME_NORETURN OBJ_GETTER(Kotlin_ObjCExport_getWrappedError, KRef throwable) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void Kotlin_ObjCExport_resumeContinuationFailure(KRef continuation, KRef exception) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
void Kotlin_ObjCExport_resumeContinuationSuccess(KRef continuation, KRef result) {
THROW_NOT_IMPLEMENTED
throw std::runtime_error("Not implemented for tests");
}
} // extern "C"