diff options
author | Bo Hu <bohu@google.com> | 2014-11-18 23:41:03 +0000 |
---|---|---|
committer | Bo Hu <bohu@google.com> | 2014-11-18 23:41:03 +0000 |
commit | 71f865816c798e062316da11b4764dc5e7e7c840 (patch) | |
tree | a5e5755566189a318c6395b0a03762dc6b528cc7 /emulator | |
parent | d4ddf47c4ef330fd40ea89dfa3279aca5b7facf0 (diff) | |
download | sdk-71f865816c798e062316da11b4764dc5e7e7c840.zip sdk-71f865816c798e062316da11b4764dc5e7e7c840.tar.gz sdk-71f865816c798e062316da11b4764dc5e7e7c840.tar.bz2 |
Need to revert this one and cherry pick earlier CLs first
Revert "emulator/opengl: Add emugen test suite."
This reverts commit d4ddf47c4ef330fd40ea89dfa3279aca5b7facf0.
Change-Id: I01a5f93453d90cb4f666c99c41cc95048c4411db
Diffstat (limited to 'emulator')
22 files changed, 0 insertions, 629 deletions
diff --git a/emulator/opengl/host/tools/emugen/tests/run-tests.sh b/emulator/opengl/host/tools/emugen/tests/run-tests.sh deleted file mode 100755 index 67409ed..0000000 --- a/emulator/opengl/host/tools/emugen/tests/run-tests.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/sh - -# Copyright 2014 The Android Open Source Project -# -# Licensed 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. -# - -set -e - -export LANG=C -export LC_ALL=C - -PROGDIR=$(dirname "$0") -PROGNAME=$(basename "$0") - -fatal () { - echo "ERROR: $@" - exit 1 -} - -OPT_EMUGEN= -OPT_HELP= -OPT_OUT_DIR= -OPT_TOOL= - -for OPT; do - OPTARG=$(expr "x$OPT" : "x[^=]*=\\(.*\\)" || true) - case $OPT in - --help|-h|-?) - OPT_HELP=true - ;; - --emugen=*) - OPT_EMUGEN=$OPTARG - ;; - --out-dir=*) - OPT_OUT_DIR=$OPTARG - ;; - --tool=*) - OPT_TOOL=$OPTARG - ;; - -*) - fatal "Invalid option '$OPT', see --help." - ;; - *) - fatal "This script doesn't take arguments, see --help." - ;; - esac -done - -if [ "$OPT_HELP" ]; then - cat <<EOF -Usage: $PROGNAME [options] - -Run the emugen test suite. This scripts looks for sub-directories -named t.<number>/input, and uses them as input to 'emugen'. It then -compares the output to t.<number>/expected/ content. - -Valid options: - --help|-h|-? Print this help. - --out-dir=<dir> Generate outputs into <dir>. - --emugen=<program> Emugen program path, if not in path. - --tool=<tool> Launch visual diff tool in case of differences. -EOF - exit 0 -fi - -# Find emugen program -EMUGEN= -if [ "$OPT_EMUGEN" ]; then - EMUGEN=$OPT_EMUGEN -else - EMUGEN=$(which emugen 2>/dev/null || true) - if [ -z "$EMUGEN" ]; then - fatal "Cannot find 'emugen' program in PATH, use --emugen=<program> option." - fi - echo "Auto-config: --emugen=$EMUGEN" -fi -if [ ! -f "$EMUGEN" ]; then - fatal "Emugen program doesn't exist: $EMUGEN" -fi - -# Create output directory. -OUT_DIR= -if [ "$OPT_OUT_DIR" ]; then - OUT_DIR=$OPT_OUT_DIR -else - OUT_DIR=/tmp/$USER-emugen-testing - echo "Auto-config: --out-dir=$OUT_DIR" -fi -mkdir -p "$OUT_DIR" && rm -rf "$OUT_DIR/emugen" - -OUT_DIR=$OUT_DIR/emugen - -# Find test directories -TEST_DIRS=$(cd "$PROGDIR" && find . -name "t.*" | sed -e 's|^\./||') -for TEST_DIR in $TEST_DIRS; do - IN=$PROGDIR/$TEST_DIR/input - PREFIXES=$(cd $IN && find . -name "*.in" | sed -e 's|^\./||g' -e 's|\.in$||g') - OUT=$OUT_DIR/$TEST_DIR - mkdir -p "$OUT/encoder" - mkdir -p "$OUT/decoder" - mkdir -p "$OUT/wrapper" - for PREFIX in $PREFIXES; do - echo "Processing $IN/foo.*" - $EMUGEN -i "$PROGDIR/$TEST_DIR/input" -D "$OUT/decoder" -E "$OUT/encoder" -W "$OUT/wrapper" $PREFIX - done - if ! diff -qr "$PROGDIR/$TEST_DIR/expected" "$OUT"; then - if [ "$OPT_TOOL" ]; then - $OPT_TOOL "$PROGDIR/$TEST_DIR/expected" "$OUT" - else - echo "ERROR: Invalid differences between actual and expected output!" - diff -burN "$PROGDIR/$TEST_DIR/expected" "$OUT" - exit 1 - fi - fi -done - -echo "All good!" -exit 0 diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_dec.cpp b/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_dec.cpp deleted file mode 100644 index 1f904cf..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_dec.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' - - -#include <string.h> -#include "foo_opcodes.h" - -#include "foo_dec.h" - - -#include "ProtocolUtils.h" - -#include <stdio.h> - -typedef unsigned int tsize_t; // Target "size_t", which is 32-bit for now. It may or may not be the same as host's size_t when emugen is compiled. - -#ifdef DEBUG_PRINTOUT -# define DEBUG(...) fprintf(stderr, __VA_ARGS__) -#else -# define DEBUG(...) ((void)0) -#endif - -#ifdef CHECK_GLERROR -# define SET_LASTCALL(name) sprintf(lastCall, #name) -#else -# define SET_LASTCALL(name) ((void)0) -#endif - -using namespace emugl; - -size_t foo_decoder_context_t::decode(void *buf, size_t len, IOStream *stream) -{ - - size_t pos = 0; - if (len < 8) return pos; - unsigned char *ptr = (unsigned char *)buf; - bool unknownOpcode = false; -#ifdef CHECK_GL_ERROR - char lastCall[256] = {0}; -#endif - while ((len - pos >= 8) && !unknownOpcode) { - uint32_t opcode = *(uint32_t *)ptr; - size_t packetLen = *(uint32_t *)(ptr + 4); - if (len - pos < packetLen) return pos; - switch(opcode) { - case OP_fooAlphaFunc: { - FooInt var_func = Unpack<FooInt,uint32_t>(ptr + 8); - FooFloat var_ref = Unpack<FooFloat,uint32_t>(ptr + 8 + 4); - DEBUG("foo(%p): fooAlphaFunc(%d %f )\n", stream,var_func, var_ref); - this->fooAlphaFunc(var_func, var_ref); - SET_LASTCALL("fooAlphaFunc"); - break; - } - case OP_fooIsBuffer: { - uint32_t size_stuff __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8); - InputBuffer inptr_stuff(ptr + 8 + 4, size_stuff); - size_t totalTmpSize = sizeof(FooBoolean); - unsigned char *tmpBuf = stream->alloc(totalTmpSize); - DEBUG("foo(%p): fooIsBuffer(%p(%u) )\n", stream,(void*)(inptr_stuff.get()), size_stuff); - *(FooBoolean *)(&tmpBuf[0]) = this->fooIsBuffer((void*)(inptr_stuff.get())); - stream->flush(); - SET_LASTCALL("fooIsBuffer"); - break; - } - case OP_fooUnsupported: { - uint32_t size_params __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8); - InputBuffer inptr_params(ptr + 8 + 4, size_params); - DEBUG("foo(%p): fooUnsupported(%p(%u) )\n", stream,(void*)(inptr_params.get()), size_params); - this->fooUnsupported((void*)(inptr_params.get())); - SET_LASTCALL("fooUnsupported"); - break; - } - default: - unknownOpcode = true; - } //switch - if (!unknownOpcode) { - pos += packetLen; - ptr += packetLen; - } - } // while - return pos; -} diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_dec.h b/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_dec.h deleted file mode 100644 index 8127237..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_dec.h +++ /dev/null @@ -1,18 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' - -#ifndef GUARD_foo_decoder_context_t -#define GUARD_foo_decoder_context_t - -#include "IOStream.h" -#include "foo_server_context.h" - - - -struct foo_decoder_context_t : public foo_server_context_t { - - size_t decode(void *buf, size_t bufsize, IOStream *stream); - -}; - -#endif diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_opcodes.h b/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_opcodes.h deleted file mode 100644 index 8a73ca7..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_opcodes.h +++ /dev/null @@ -1,12 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' -#ifndef __GUARD_foo_opcodes_h_ -#define __GUARD_foo_opcodes_h_ - -#define OP_fooAlphaFunc 200 -#define OP_fooIsBuffer 201 -#define OP_fooUnsupported 202 -#define OP_last 203 - - -#endif diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_server_context.cpp b/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_server_context.cpp deleted file mode 100644 index 7258565..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_server_context.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' - - -#include <string.h> -#include "foo_server_context.h" - - -#include <stdio.h> - -int foo_server_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData) -{ - fooAlphaFunc = (fooAlphaFunc_server_proc_t) getProc("fooAlphaFunc", userData); - fooIsBuffer = (fooIsBuffer_server_proc_t) getProc("fooIsBuffer", userData); - fooUnsupported = (fooUnsupported_server_proc_t) getProc("fooUnsupported", userData); - return 0; -} - diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_server_context.h b/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_server_context.h deleted file mode 100644 index 666143a..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_server_context.h +++ /dev/null @@ -1,18 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' -#ifndef __foo_server_context_t_h -#define __foo_server_context_t_h - -#include "foo_server_proc.h" - - -struct foo_server_context_t { - - fooAlphaFunc_server_proc_t fooAlphaFunc; - fooIsBuffer_server_proc_t fooIsBuffer; - fooUnsupported_server_proc_t fooUnsupported; - virtual ~foo_server_context_t() {} - int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData); -}; - -#endif diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_server_proc.h b/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_server_proc.h deleted file mode 100644 index 2444068..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/decoder/foo_server_proc.h +++ /dev/null @@ -1,17 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' -#ifndef __foo_server_proc_t_h -#define __foo_server_proc_t_h - - - -#include "foo_types.h" -#ifndef foo_APIENTRY -#define foo_APIENTRY -#endif -typedef void (foo_APIENTRY *fooAlphaFunc_server_proc_t) (FooInt, FooFloat); -typedef FooBoolean (foo_APIENTRY *fooIsBuffer_server_proc_t) (void*); -typedef void (foo_APIENTRY *fooUnsupported_server_proc_t) (void*); - - -#endif diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_context.cpp b/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_context.cpp deleted file mode 100644 index 1bc2e1e..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_context.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' - - -#include <string.h> -#include "foo_client_context.h" - - -#include <stdio.h> - -int foo_client_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData) -{ - fooAlphaFunc = (fooAlphaFunc_client_proc_t) getProc("fooAlphaFunc", userData); - fooIsBuffer = (fooIsBuffer_client_proc_t) getProc("fooIsBuffer", userData); - fooUnsupported = (fooUnsupported_client_proc_t) getProc("fooUnsupported", userData); - return 0; -} - diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_context.h b/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_context.h deleted file mode 100644 index c4e44ad..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_context.h +++ /dev/null @@ -1,23 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' -#ifndef __foo_client_context_t_h -#define __foo_client_context_t_h - -#include "foo_client_proc.h" - - -struct foo_client_context_t { - - fooAlphaFunc_client_proc_t fooAlphaFunc; - fooIsBuffer_client_proc_t fooIsBuffer; - fooUnsupported_client_proc_t fooUnsupported; - virtual ~foo_client_context_t() {} - - typedef foo_client_context_t *CONTEXT_ACCESSOR_TYPE(void); - static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f); - int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData); - virtual void setError(unsigned int error){}; - virtual unsigned int getError(){ return 0; }; -}; - -#endif diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_proc.h b/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_proc.h deleted file mode 100644 index 6b8f211..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_proc.h +++ /dev/null @@ -1,17 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' -#ifndef __foo_client_proc_t_h -#define __foo_client_proc_t_h - - - -#include "foo_types.h" -#ifndef foo_APIENTRY -#define foo_APIENTRY -#endif -typedef void (foo_APIENTRY *fooAlphaFunc_client_proc_t) (void * ctx, FooInt, FooFloat); -typedef FooBoolean (foo_APIENTRY *fooIsBuffer_client_proc_t) (void * ctx, void*); -typedef void (foo_APIENTRY *fooUnsupported_client_proc_t) (void * ctx, void*); - - -#endif diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_enc.cpp b/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_enc.cpp deleted file mode 100644 index b1f66b7..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_enc.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' - - -#include <string.h> -#include "foo_opcodes.h" - -#include "foo_enc.h" - - -#include <stdio.h> -static void enc_unsupported() -{ - ALOGE("Function is unsupported\n"); -} - -void fooAlphaFunc_enc(void *self , FooInt func, FooFloat ref) -{ - - foo_encoder_context_t *ctx = (foo_encoder_context_t *)self; - IOStream *stream = ctx->m_stream; - - unsigned char *ptr; - const size_t packetSize = 8 + 4 + 4; - ptr = stream->alloc(packetSize); - int tmp = OP_fooAlphaFunc;memcpy(ptr, &tmp, 4); ptr += 4; - memcpy(ptr, &packetSize, 4); ptr += 4; - - memcpy(ptr, &func, 4); ptr += 4; - memcpy(ptr, &ref, 4); ptr += 4; -} - -FooBoolean fooIsBuffer_enc(void *self , void* stuff) -{ - - foo_encoder_context_t *ctx = (foo_encoder_context_t *)self; - IOStream *stream = ctx->m_stream; - - const unsigned int __size_stuff = (4 * sizeof(float)); - unsigned char *ptr; - const size_t packetSize = 8 + __size_stuff + 1*4; - ptr = stream->alloc(packetSize); - int tmp = OP_fooIsBuffer;memcpy(ptr, &tmp, 4); ptr += 4; - memcpy(ptr, &packetSize, 4); ptr += 4; - - *(unsigned int *)(ptr) = __size_stuff; ptr += 4; - memcpy(ptr, stuff, __size_stuff);ptr += __size_stuff; - - FooBoolean retval; - stream->readback(&retval, 1); - return retval; -} - -foo_encoder_context_t::foo_encoder_context_t(IOStream *stream) -{ - m_stream = stream; - - fooAlphaFunc = (fooAlphaFunc_enc); - fooIsBuffer = (fooIsBuffer_enc); - fooUnsupported = (fooUnsupported_client_proc_t)(enc_unsupported); -} - diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_enc.h b/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_enc.h deleted file mode 100644 index a86956f..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_enc.h +++ /dev/null @@ -1,28 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' - -#ifndef GUARD_foo_encoder_context_t -#define GUARD_foo_encoder_context_t - -#include "IOStream.h" -#include "foo_client_context.h" - - -#include "fooUtils.h" -#include "fooBase.h" - -struct foo_encoder_context_t : public foo_client_context_t { - - IOStream *m_stream; - - foo_encoder_context_t(IOStream *stream); - - -}; - -extern "C" { - void fooAlphaFunc_enc(void *self , FooInt func, FooFloat ref); - FooBoolean fooIsBuffer_enc(void *self , void* stuff); - void fooUnsupported_enc(void *self , void* params); -}; -#endif
\ No newline at end of file diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_entry.cpp b/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_entry.cpp deleted file mode 100644 index 1caacd2..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_entry.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' -#include <stdio.h> -#include <stdlib.h> -#include "foo_client_context.h" - -#ifndef GL_TRUE -extern "C" { - void fooAlphaFunc(FooInt func, FooFloat ref); - FooBoolean fooIsBuffer(void* stuff); - void fooUnsupported(void* params); -}; - -#endif -#ifndef GET_CONTEXT -static foo_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL; -void foo_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; } -#define GET_CONTEXT foo_client_context_t * ctx = getCurrentContext() -#endif - -void fooAlphaFunc(FooInt func, FooFloat ref) -{ - GET_CONTEXT; - ctx->fooAlphaFunc(ctx, func, ref); -} - -FooBoolean fooIsBuffer(void* stuff) -{ - GET_CONTEXT; - if (n == NULL) { LOG(ERROR) << "NULL stuff"; return; } - return ctx->fooIsBuffer(ctx, stuff); -} - -void fooUnsupported(void* params) -{ - GET_CONTEXT; - ctx->fooUnsupported(ctx, params); -} - diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_ftable.h b/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_ftable.h deleted file mode 100644 index 87fb3f6..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_ftable.h +++ /dev/null @@ -1,18 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' -#ifndef __foo_client_ftable_t_h -#define __foo_client_ftable_t_h - - -static struct _foo_funcs_by_name { - const char *name; - void *proc; -} foo_funcs_by_name[] = { - {"fooAlphaFunc", (void*)fooAlphaFunc}, - {"fooIsBuffer", (void*)fooIsBuffer}, - {"fooUnsupported", (void*)fooUnsupported}, -}; -static int foo_num_funcs = sizeof(foo_funcs_by_name) / sizeof(struct _foo_funcs_by_name); - - -#endif diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_opcodes.h b/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_opcodes.h deleted file mode 100644 index 8a73ca7..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/encoder/foo_opcodes.h +++ /dev/null @@ -1,12 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' -#ifndef __GUARD_foo_opcodes_h_ -#define __GUARD_foo_opcodes_h_ - -#define OP_fooAlphaFunc 200 -#define OP_fooIsBuffer 201 -#define OP_fooUnsupported 202 -#define OP_last 203 - - -#endif diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_context.cpp b/emulator/opengl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_context.cpp deleted file mode 100644 index 7e2d3f0..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_context.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' - - -#include <string.h> -#include "foo_wrapper_context.h" - - -#include <stdio.h> - -int foo_wrapper_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData) -{ - fooAlphaFunc = (fooAlphaFunc_wrapper_proc_t) getProc("fooAlphaFunc", userData); - fooIsBuffer = (fooIsBuffer_wrapper_proc_t) getProc("fooIsBuffer", userData); - fooUnsupported = (fooUnsupported_wrapper_proc_t) getProc("fooUnsupported", userData); - return 0; -} - diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_context.h b/emulator/opengl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_context.h deleted file mode 100644 index 047b686..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_context.h +++ /dev/null @@ -1,21 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' -#ifndef __foo_wrapper_context_t_h -#define __foo_wrapper_context_t_h - -#include "foo_wrapper_proc.h" - - -struct foo_wrapper_context_t { - - fooAlphaFunc_wrapper_proc_t fooAlphaFunc; - fooIsBuffer_wrapper_proc_t fooIsBuffer; - fooUnsupported_wrapper_proc_t fooUnsupported; - virtual ~foo_wrapper_context_t() {} - - typedef foo_wrapper_context_t *CONTEXT_ACCESSOR_TYPE(void); - static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f); - int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData); -}; - -#endif diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_entry.cpp b/emulator/opengl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_entry.cpp deleted file mode 100644 index 2dc18a9..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_entry.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' -#include <stdio.h> -#include <stdlib.h> -#include "foo_wrapper_context.h" - -#ifndef GL_TRUE -extern "C" { - void fooAlphaFunc(FooInt func, FooFloat ref); - FooBoolean fooIsBuffer(void* stuff); - void fooUnsupported(void* params); -}; - -#endif -#ifndef GET_CONTEXT -static foo_wrapper_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL; -void foo_wrapper_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; } -#define GET_CONTEXT foo_wrapper_context_t * ctx = getCurrentContext() -#endif - -void fooAlphaFunc(FooInt func, FooFloat ref) -{ - GET_CONTEXT; - ctx->fooAlphaFunc( func, ref); -} - -FooBoolean fooIsBuffer(void* stuff) -{ - GET_CONTEXT; - return ctx->fooIsBuffer( stuff); -} - -void fooUnsupported(void* params) -{ - GET_CONTEXT; - ctx->fooUnsupported( params); -} - diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_proc.h b/emulator/opengl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_proc.h deleted file mode 100644 index 8c707d0..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_proc.h +++ /dev/null @@ -1,17 +0,0 @@ -// Generated Code - DO NOT EDIT !! -// generated by 'emugen' -#ifndef __foo_wrapper_proc_t_h -#define __foo_wrapper_proc_t_h - - - -#include "foo_types.h" -#ifndef foo_APIENTRY -#define foo_APIENTRY -#endif -typedef void (foo_APIENTRY *fooAlphaFunc_wrapper_proc_t) (FooInt, FooFloat); -typedef FooBoolean (foo_APIENTRY *fooIsBuffer_wrapper_proc_t) (void*); -typedef void (foo_APIENTRY *fooUnsupported_wrapper_proc_t) (void*); - - -#endif diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/input/foo.attrib b/emulator/opengl/host/tools/emugen/tests/t.001/input/foo.attrib deleted file mode 100644 index 14715ed..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/input/foo.attrib +++ /dev/null @@ -1,12 +0,0 @@ -GLOBAL - base_opcode 200 - encoder_headers "fooUtils.h" "fooBase.h" - -fooIsBuffer - dir stuff in - len stuff (4 * sizeof(float)) - param_check stuff if (n == NULL) { LOG(ERROR) << "NULL stuff"; return; } - -fooUnsupported - dir params in - flag unsupported diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/input/foo.in b/emulator/opengl/host/tools/emugen/tests/t.001/input/foo.in deleted file mode 100644 index 178a6b4..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/input/foo.in +++ /dev/null @@ -1,3 +0,0 @@ -FOO_ENTRY(void, fooAlphaFunc, FooInt func, FooFloat ref) -FOO_ENTRY(FooBoolean, fooIsBuffer, void* stuff) -FOO_ENTRY(void, fooUnsupported, void* params) diff --git a/emulator/opengl/host/tools/emugen/tests/t.001/input/foo.types b/emulator/opengl/host/tools/emugen/tests/t.001/input/foo.types deleted file mode 100644 index c4140d1..0000000 --- a/emulator/opengl/host/tools/emugen/tests/t.001/input/foo.types +++ /dev/null @@ -1,9 +0,0 @@ -FooBoolean 8 %d -FooInt 32 %d -FooShort 16 %d -FooFloat 32 %f -FooEnum 32 %08x -FooVoid 0 %x -FooChar 8 %d -FooChar* 32 0x%08x -void* 32 0x%08x
\ No newline at end of file |