/*
 * This file was generated automatically by ExtUtils::ParseXS version 3.45 from the
 * contents of Test.xs. Do not edit this file, edit Test.xs instead.
 *
 *    ANY CHANGES MADE HERE WILL BE LOST!
 *
 */

#line 1 "lib/Clownfish/Test.xs"
/*
 * ***********************************************
 * 
 * !!!! DO NOT EDIT !!!!
 * 
 * This file was auto-generated by Build.PL.
 * 
 * ***********************************************
 * 
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#define CFP_TESTCFISH

#include "XSBind.h"
#include "testcfish_perl.h"
#include "Clownfish/Test/TestMethod.h"
#include "Clownfish/Test/TestLockFreeRegistry.h"
#include "Clownfish/Test/TestBoolean.h"
#include "Clownfish/Test/Util/TestAtomic.h"
#include "Clownfish/Test/Util/TestMemory.h"
#include "Clownfish/Test/TestVector.h"
#include "Clownfish/Test/TestByteBuf.h"
#include "Clownfish/Test/TestErr.h"
#include "Clownfish/Test/TestBlob.h"
#include "Clownfish/Test/TestCharBuf.h"
#include "Clownfish/Test/TestNum.h"
#include "Clownfish/Test/TestHashIterator.h"
#include "Clownfish/Test/TestPtrHash.h"
#include "Clownfish/Test/TestObj.h"
#include "Clownfish/Test/TestHash.h"
#include "Clownfish/Test/TestString.h"
#include "Clownfish/Test/TestClass.h"
#include "Clownfish/Test/TestString.h"
#include "Clownfish/Test/TestHost.h"
#include "Clownfish/Test.h"

#ifndef XS_INTERNAL
  #define XS_INTERNAL XS
#endif

XS_INTERNAL(XS_Clownfish_Test_TestMethod_run);
XS_INTERNAL(XS_Clownfish_Test_TestMethod_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestMethod* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestMethod_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestMethod*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTMETHOD, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTMETHOD, TESTCFISH_TestMethod_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestLockFreeRegistry_run);
XS_INTERNAL(XS_Clownfish_Test_TestLockFreeRegistry_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestLockFreeRegistry* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestLFReg_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestLockFreeRegistry*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTLOCKFREEREGISTRY, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTLOCKFREEREGISTRY, TESTCFISH_TestLFReg_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestBoolean_run);
XS_INTERNAL(XS_Clownfish_Test_TestBoolean_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestBoolean* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestBoolean_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestBoolean*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTBOOLEAN, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTBOOLEAN, TESTCFISH_TestBoolean_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_Util_TestAtomic_run);
XS_INTERNAL(XS_Clownfish_Test_Util_TestAtomic_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestAtomic* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestAtomic_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestAtomic*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTATOMIC, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTATOMIC, TESTCFISH_TestAtomic_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_Util_TestMemory_run);
XS_INTERNAL(XS_Clownfish_Test_Util_TestMemory_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestMemory* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestMemory_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestMemory*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTMEMORY, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTMEMORY, TESTCFISH_TestMemory_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestVector_run);
XS_INTERNAL(XS_Clownfish_Test_TestVector_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestVector* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestVector_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTVECTOR, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTVECTOR, TESTCFISH_TestVector_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestByteBuf_run);
XS_INTERNAL(XS_Clownfish_Test_TestByteBuf_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestByteBuf* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestBB_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestByteBuf*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTBYTEBUF, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTBYTEBUF, TESTCFISH_TestBB_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestErr_run);
XS_INTERNAL(XS_Clownfish_Test_TestErr_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestErr* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestErr_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestErr*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTERR, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTERR, TESTCFISH_TestErr_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestBlob_run);
XS_INTERNAL(XS_Clownfish_Test_TestBlob_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestBlob* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestBlob_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestBlob*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTBLOB, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTBLOB, TESTCFISH_TestBlob_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestCharBuf_run);
XS_INTERNAL(XS_Clownfish_Test_TestCharBuf_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestCharBuf* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestCB_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestCharBuf*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTCHARBUF, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTCHARBUF, TESTCFISH_TestCB_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestNum_run);
XS_INTERNAL(XS_Clownfish_Test_TestNum_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestNum* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestNum_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestNum*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTNUM, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTNUM, TESTCFISH_TestNum_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestHashIterator_run);
XS_INTERNAL(XS_Clownfish_Test_TestHashIterator_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestHashIterator* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestHashIterator_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestHashIterator*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHASHITERATOR, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHASHITERATOR, TESTCFISH_TestHashIterator_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestPtrHash_run);
XS_INTERNAL(XS_Clownfish_Test_TestPtrHash_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestPtrHash* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestPtrHash_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestPtrHash*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTPTRHASH, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTPTRHASH, TESTCFISH_TestPtrHash_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestObj_run);
XS_INTERNAL(XS_Clownfish_Test_TestObj_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestObj* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestObj_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestObj*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTOBJ, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTOBJ, TESTCFISH_TestObj_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestHash_run);
XS_INTERNAL(XS_Clownfish_Test_TestHash_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestHash* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestHash_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestHash*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHASH, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHASH, TESTCFISH_TestHash_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestString_run);
XS_INTERNAL(XS_Clownfish_Test_TestString_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestString* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestStr_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestString*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTSTRING, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTSTRING, TESTCFISH_TestStr_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestClass_run);
XS_INTERNAL(XS_Clownfish_Test_TestClass_run) {
    dXSARGS;
    SV *sv;
    testcfish_TestClass* arg_self;
    cfish_TestBatchRunner* arg_runner;
    TESTCFISH_TestClass_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, runner");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestClass*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTCLASS, NULL);
    sv = ST(1);
    arg_runner = (cfish_TestBatchRunner*)XSBind_arg_to_cfish(aTHX_ sv, "runner", CFISH_TESTBATCHRUNNER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTCLASS, TESTCFISH_TestClass_Run);
    method(arg_self, arg_runner);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_StringCallbackTest_unchanged_by_callback);
XS_INTERNAL(XS_Clownfish_Test_StringCallbackTest_unchanged_by_callback) {
    dXSARGS;
    SV *sv;
    testcfish_StringCallbackTest* arg_self;
    cfish_String* arg_str;
    TESTCFISH_StrCbTest_Unchanged_By_Callback_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, str");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_StringCallbackTest*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_STRINGCALLBACKTEST, NULL);
    sv = ST(1);
    arg_str = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "str", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_STRINGCALLBACKTEST, TESTCFISH_StrCbTest_Unchanged_By_Callback);
    retval = method(arg_self, arg_str);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Clownfish_Test_StringCallbackTest_callback);
XS_INTERNAL(XS_Clownfish_Test_StringCallbackTest_callback) {
    dXSARGS;
    testcfish_StringCallbackTest* arg_self;
    TESTCFISH_StrCbTest_Callback_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_StringCallbackTest*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_STRINGCALLBACKTEST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_STRINGCALLBACKTEST, TESTCFISH_StrCbTest_Callback);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_test_obj_pos_arg);
XS_INTERNAL(XS_Clownfish_Test_TestHost_test_obj_pos_arg) {
    dXSARGS;
    SV *sv;
    testcfish_TestHost* arg_self;
    cfish_Obj* arg_arg;
    TESTCFISH_TestHost_Test_Obj_Pos_Arg_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, arg");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);
    sv = ST(1);
    arg_arg = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "arg", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Test_Obj_Pos_Arg);
    retval = method(arg_self, arg_arg);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_test_obj_pos_arg_def);
XS_INTERNAL(XS_Clownfish_Test_TestHost_test_obj_pos_arg_def) {
    dXSARGS;
    SV *sv;
    testcfish_TestHost* arg_self;
    cfish_Obj* arg_arg;
    TESTCFISH_TestHost_Test_Obj_Pos_Arg_Def_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [arg]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);
    sv = ST(1);
    arg_arg = 1 < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "arg", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Test_Obj_Pos_Arg_Def);
    retval = method(arg_self, arg_arg);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_test_obj_label_arg);
XS_INTERNAL(XS_Clownfish_Test_TestHost_test_obj_label_arg) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("arg", 1),
        XSBIND_PARAM("unused", 0)
    };
    int32_t locations[2];
    SV *sv;
    testcfish_TestHost* arg_self;
    cfish_Obj* arg_arg;
    bool arg_unused;
    TESTCFISH_TestHost_Test_Obj_Label_Arg_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);
    sv = ST(locations[0]);
    arg_arg = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "arg", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_unused = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Test_Obj_Label_Arg);
    retval = method(arg_self, arg_arg, arg_unused);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_test_obj_label_arg_def);
XS_INTERNAL(XS_Clownfish_Test_TestHost_test_obj_label_arg_def) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("arg", 0),
        XSBIND_PARAM("unused", 0)
    };
    int32_t locations[2];
    SV *sv;
    testcfish_TestHost* arg_self;
    cfish_Obj* arg_arg;
    bool arg_unused;
    TESTCFISH_TestHost_Test_Obj_Label_Arg_Def_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);
    sv = ST(locations[0]);
    arg_arg = locations[0] < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "arg", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[1]);
    arg_unused = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Test_Obj_Label_Arg_Def);
    retval = method(arg_self, arg_arg, arg_unused);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_test_int32_pos_arg);
XS_INTERNAL(XS_Clownfish_Test_TestHost_test_int32_pos_arg) {
    dXSARGS;
    SV *sv;
    testcfish_TestHost* arg_self;
    int32_t arg_arg;
    TESTCFISH_TestHost_Test_Int32_Pos_Arg_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, arg");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "arg");
    }
    arg_arg = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Test_Int32_Pos_Arg);
    retval = method(arg_self, arg_arg);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_test_int32_pos_arg_def);
XS_INTERNAL(XS_Clownfish_Test_TestHost_test_int32_pos_arg_def) {
    dXSARGS;
    SV *sv;
    testcfish_TestHost* arg_self;
    int32_t arg_arg;
    TESTCFISH_TestHost_Test_Int32_Pos_Arg_Def_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [arg]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);
    sv = ST(1);
    arg_arg = 1 < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 101;

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Test_Int32_Pos_Arg_Def);
    retval = method(arg_self, arg_arg);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_test_int32_label_arg);
XS_INTERNAL(XS_Clownfish_Test_TestHost_test_int32_label_arg) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("arg", 1),
        XSBIND_PARAM("unused", 0)
    };
    int32_t locations[2];
    SV *sv;
    testcfish_TestHost* arg_self;
    int32_t arg_arg;
    bool arg_unused;
    TESTCFISH_TestHost_Test_Int32_Label_Arg_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "arg");
    }
    arg_arg = (int32_t)SvIV(sv);
    sv = ST(locations[1]);
    arg_unused = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Test_Int32_Label_Arg);
    retval = method(arg_self, arg_arg, arg_unused);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_test_int32_label_arg_def);
XS_INTERNAL(XS_Clownfish_Test_TestHost_test_int32_label_arg_def) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("arg", 0),
        XSBIND_PARAM("unused", 0)
    };
    int32_t locations[2];
    SV *sv;
    testcfish_TestHost* arg_self;
    int32_t arg_arg;
    bool arg_unused;
    TESTCFISH_TestHost_Test_Int32_Label_Arg_Def_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);
    sv = ST(locations[0]);
    arg_arg = locations[0] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 101;
    sv = ST(locations[1]);
    arg_unused = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Test_Int32_Label_Arg_Def);
    retval = method(arg_self, arg_arg, arg_unused);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_test_bool_pos_arg);
XS_INTERNAL(XS_Clownfish_Test_TestHost_test_bool_pos_arg) {
    dXSARGS;
    SV *sv;
    testcfish_TestHost* arg_self;
    bool arg_arg;
    TESTCFISH_TestHost_Test_Bool_Pos_Arg_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, arg");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "arg");
    }
    arg_arg = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Test_Bool_Pos_Arg);
    retval = method(arg_self, arg_arg);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_test_bool_pos_arg_def);
XS_INTERNAL(XS_Clownfish_Test_TestHost_test_bool_pos_arg_def) {
    dXSARGS;
    SV *sv;
    testcfish_TestHost* arg_self;
    bool arg_arg;
    TESTCFISH_TestHost_Test_Bool_Pos_Arg_Def_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [arg]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);
    sv = ST(1);
    arg_arg = 1 < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Test_Bool_Pos_Arg_Def);
    retval = method(arg_self, arg_arg);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_test_bool_label_arg);
XS_INTERNAL(XS_Clownfish_Test_TestHost_test_bool_label_arg) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("arg", 1),
        XSBIND_PARAM("unused", 0)
    };
    int32_t locations[2];
    SV *sv;
    testcfish_TestHost* arg_self;
    bool arg_arg;
    bool arg_unused;
    TESTCFISH_TestHost_Test_Bool_Label_Arg_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "arg");
    }
    arg_arg = XSBind_sv_true(aTHX_ sv);
    sv = ST(locations[1]);
    arg_unused = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Test_Bool_Label_Arg);
    retval = method(arg_self, arg_arg, arg_unused);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_test_bool_label_arg_def);
XS_INTERNAL(XS_Clownfish_Test_TestHost_test_bool_label_arg_def) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("arg", 0),
        XSBIND_PARAM("unused", 0)
    };
    int32_t locations[2];
    SV *sv;
    testcfish_TestHost* arg_self;
    bool arg_arg;
    bool arg_unused;
    TESTCFISH_TestHost_Test_Bool_Label_Arg_Def_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);
    sv = ST(locations[0]);
    arg_arg = locations[0] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[1]);
    arg_unused = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Test_Bool_Label_Arg_Def);
    retval = method(arg_self, arg_arg, arg_unused);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_invoke_invalid_callback_from_c);
XS_INTERNAL(XS_Clownfish_Test_TestHost_invoke_invalid_callback_from_c) {
    dXSARGS;
    testcfish_TestHost* arg_self;
    TESTCFISH_TestHost_Invoke_Invalid_Callback_From_C_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Invoke_Invalid_Callback_From_C);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_perl_alias);
XS_INTERNAL(XS_Clownfish_Test_TestHost_perl_alias) {
    dXSARGS;
    testcfish_TestHost* arg_self;
    TESTCFISH_TestHost_Aliased_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Aliased);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Clownfish_Test_TestHost_invoke_aliased_from_c);
XS_INTERNAL(XS_Clownfish_Test_TestHost_invoke_aliased_from_c) {
    dXSARGS;
    testcfish_TestHost* arg_self;
    TESTCFISH_TestHost_Invoke_Aliased_From_C_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (testcfish_TestHost*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), TESTCFISH_TESTHOST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(TESTCFISH_TESTHOST, TESTCFISH_TestHost_Invoke_Aliased_From_C);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}


#line 1029 "lib/Clownfish/Test.c"
#ifndef PERL_UNUSED_VAR
#  define PERL_UNUSED_VAR(var) if (0) var = var
#endif

#ifndef dVAR
#  define dVAR		dNOOP
#endif


/* This stuff is not part of the API! You have been warned. */
#ifndef PERL_VERSION_DECIMAL
#  define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
#endif
#ifndef PERL_DECIMAL_VERSION
#  define PERL_DECIMAL_VERSION \
	  PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
#endif
#ifndef PERL_VERSION_GE
#  define PERL_VERSION_GE(r,v,s) \
	  (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
#endif
#ifndef PERL_VERSION_LE
#  define PERL_VERSION_LE(r,v,s) \
	  (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
#endif

/* XS_INTERNAL is the explicit static-linkage variant of the default
 * XS macro.
 *
 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
 * "STATIC", ie. it exports XSUB symbols. You probably don't want that
 * for anything but the BOOT XSUB.
 *
 * See XSUB.h in core!
 */


/* TODO: This might be compatible further back than 5.10.0. */
#if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
#  undef XS_EXTERNAL
#  undef XS_INTERNAL
#  if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
#    define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
#    define XS_INTERNAL(name) STATIC XSPROTO(name)
#  endif
#  if defined(__SYMBIAN32__)
#    define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
#    define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
#  endif
#  ifndef XS_EXTERNAL
#    if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
#      define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
#      define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
#    else
#      ifdef __cplusplus
#        define XS_EXTERNAL(name) extern "C" XSPROTO(name)
#        define XS_INTERNAL(name) static XSPROTO(name)
#      else
#        define XS_EXTERNAL(name) XSPROTO(name)
#        define XS_INTERNAL(name) STATIC XSPROTO(name)
#      endif
#    endif
#  endif
#endif

/* perl >= 5.10.0 && perl <= 5.15.1 */


/* The XS_EXTERNAL macro is used for functions that must not be static
 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
 * macro defined, the best we can do is assume XS is the same.
 * Dito for XS_INTERNAL.
 */
#ifndef XS_EXTERNAL
#  define XS_EXTERNAL(name) XS(name)
#endif
#ifndef XS_INTERNAL
#  define XS_INTERNAL(name) XS(name)
#endif

/* Now, finally, after all this mess, we want an ExtUtils::ParseXS
 * internal macro that we're free to redefine for varying linkage due
 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
 */

#undef XS_EUPXS
#if defined(PERL_EUPXS_ALWAYS_EXPORT)
#  define XS_EUPXS(name) XS_EXTERNAL(name)
#else
   /* default to internal */
#  define XS_EUPXS(name) XS_INTERNAL(name)
#endif

#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)

/* prototype to pass -Wmissing-prototypes */
STATIC void
S_croak_xs_usage(const CV *const cv, const char *const params);

STATIC void
S_croak_xs_usage(const CV *const cv, const char *const params)
{
    const GV *const gv = CvGV(cv);

    PERL_ARGS_ASSERT_CROAK_XS_USAGE;

    if (gv) {
        const char *const gvname = GvNAME(gv);
        const HV *const stash = GvSTASH(gv);
        const char *const hvname = stash ? HvNAME(stash) : NULL;

        if (hvname)
	    Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
        else
	    Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
    } else {
        /* Pants. I don't think that it should be possible to get here. */
	Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
    }
}
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE

#define croak_xs_usage        S_croak_xs_usage

#endif

/* NOTE: the prototype of newXSproto() is different in versions of perls,
 * so we define a portable version of newXSproto()
 */
#ifdef newXS_flags
#define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
#else
#define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
#endif /* !defined(newXS_flags) */

#if PERL_VERSION_LE(5, 21, 5)
#  define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file)
#else
#  define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
#endif

#line 1173 "lib/Clownfish/Test.c"

XS_EUPXS(XS_Clownfish__Test_create_test_suite); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Clownfish__Test_create_test_suite)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	SV *	RETVAL;
#line 1095 "lib/Clownfish/Test.xs"
    cfish_TestSuite *suite = testcfish_Test_create_test_suite();
    RETVAL = CFISH_OBJ_TO_SV_NOINC(suite);
#line 1186 "lib/Clownfish/Test.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Clownfish__Test_invoke_to_string); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Clownfish__Test_invoke_to_string)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "obj");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	cfish_Obj *    obj = (cfish_Obj*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), CFISH_OBJ, NULL)
;
#line 1103 "lib/Clownfish/Test.xs"
    cfish_String *str = CFISH_Obj_To_String(obj);
    CFISH_DECREF(str);
#line 1208 "lib/Clownfish/Test.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Clownfish__Test_refcount); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Clownfish__Test_refcount)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "obj");
    {
	cfish_Obj *    obj = (cfish_Obj*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), CFISH_OBJ, NULL)
;
	int	RETVAL;
	dXSTARG;
#line 1110 "lib/Clownfish/Test.xs"
    RETVAL = (int)CFISH_REFCOUNT_NN(obj);
#line 1228 "lib/Clownfish/Test.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Clownfish__Test); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Clownfish__Test)
{
#if PERL_VERSION_LE(5, 21, 5)
    dVAR; dXSARGS;
#else
    dVAR; dXSBOOTARGSXSAPIVERCHK;
#endif
#if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
    char* file = __FILE__;
#else
    const char* file = __FILE__;
#endif

    PERL_UNUSED_VAR(file);

    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
#if PERL_VERSION_LE(5, 21, 5)
    XS_VERSION_BOOTCHECK;
#  ifdef XS_APIVERSION_BOOTCHECK
    XS_APIVERSION_BOOTCHECK;
#  endif
#endif

        newXS_deffile("Clownfish::Test::create_test_suite", XS_Clownfish__Test_create_test_suite);
        newXS_deffile("Clownfish::Test::invoke_to_string", XS_Clownfish__Test_invoke_to_string);
        newXS_deffile("Clownfish::Test::refcount", XS_Clownfish__Test_refcount);

    /* Initialisation Section */

#line 1022 "lib/Clownfish/Test.xs"
{
    static const cfish_XSBind_ClassSpec class_specs[] = {
        { "Clownfish::Test::TestMethod", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::TestLockFreeRegistry", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::TestBoolean", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::Util::TestAtomic", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::Util::TestMemory", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::TestVector", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::TestByteBuf", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::TestErr", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::TestBlob", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::TestCharBuf", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::TestNum", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::TestHashIterator", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::TestPtrHash", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::TestObj", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::TestHash", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::TestString", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::TestClass", "Clownfish::TestHarness::TestBatch", 1 },
        { "Clownfish::Test::StringCallbackTest", "Clownfish::Obj", 2 },
        { "Clownfish::Test::TestHost", "Clownfish::Obj", 15 }
    };
    static const cfish_XSBind_XSubSpec xsub_specs[] = {
        { "run", XS_Clownfish_Test_TestMethod_run },
        { "run", XS_Clownfish_Test_TestLockFreeRegistry_run },
        { "run", XS_Clownfish_Test_TestBoolean_run },
        { "run", XS_Clownfish_Test_Util_TestAtomic_run },
        { "run", XS_Clownfish_Test_Util_TestMemory_run },
        { "run", XS_Clownfish_Test_TestVector_run },
        { "run", XS_Clownfish_Test_TestByteBuf_run },
        { "run", XS_Clownfish_Test_TestErr_run },
        { "run", XS_Clownfish_Test_TestBlob_run },
        { "run", XS_Clownfish_Test_TestCharBuf_run },
        { "run", XS_Clownfish_Test_TestNum_run },
        { "run", XS_Clownfish_Test_TestHashIterator_run },
        { "run", XS_Clownfish_Test_TestPtrHash_run },
        { "run", XS_Clownfish_Test_TestObj_run },
        { "run", XS_Clownfish_Test_TestHash_run },
        { "run", XS_Clownfish_Test_TestString_run },
        { "run", XS_Clownfish_Test_TestClass_run },
        { "unchanged_by_callback", XS_Clownfish_Test_StringCallbackTest_unchanged_by_callback },
        { "callback", XS_Clownfish_Test_StringCallbackTest_callback },
        { "test_obj_pos_arg", XS_Clownfish_Test_TestHost_test_obj_pos_arg },
        { "test_obj_pos_arg_def", XS_Clownfish_Test_TestHost_test_obj_pos_arg_def },
        { "test_obj_label_arg", XS_Clownfish_Test_TestHost_test_obj_label_arg },
        { "test_obj_label_arg_def", XS_Clownfish_Test_TestHost_test_obj_label_arg_def },
        { "test_int32_pos_arg", XS_Clownfish_Test_TestHost_test_int32_pos_arg },
        { "test_int32_pos_arg_def", XS_Clownfish_Test_TestHost_test_int32_pos_arg_def },
        { "test_int32_label_arg", XS_Clownfish_Test_TestHost_test_int32_label_arg },
        { "test_int32_label_arg_def", XS_Clownfish_Test_TestHost_test_int32_label_arg_def },
        { "test_bool_pos_arg", XS_Clownfish_Test_TestHost_test_bool_pos_arg },
        { "test_bool_pos_arg_def", XS_Clownfish_Test_TestHost_test_bool_pos_arg_def },
        { "test_bool_label_arg", XS_Clownfish_Test_TestHost_test_bool_label_arg },
        { "test_bool_label_arg_def", XS_Clownfish_Test_TestHost_test_bool_label_arg_def },
        { "invoke_invalid_callback_from_c", XS_Clownfish_Test_TestHost_invoke_invalid_callback_from_c },
        { "perl_alias", XS_Clownfish_Test_TestHost_perl_alias },
        { "invoke_aliased_from_c", XS_Clownfish_Test_TestHost_invoke_aliased_from_c }
    };
    size_t num_classes
        = sizeof(class_specs) / sizeof(class_specs[0]);
    const char* file = __FILE__;

    testcfish_bootstrap_perl();

    cfish_XSBind_bootstrap(aTHX_ num_classes, class_specs,
                           xsub_specs, file);
}

#line 1338 "lib/Clownfish/Test.c"

    /* End of Initialisation Section */

#if PERL_VERSION_LE(5, 21, 5)
#  if PERL_VERSION_GE(5, 9, 0)
    if (PL_unitcheckav)
        call_list(PL_scopestack_ix, PL_unitcheckav);
#  endif
    XSRETURN_YES;
#else
    Perl_xs_boot_epilog(aTHX_ ax);
#endif
}

