From 3f2b5033eec07763ca6fec6e4516b52abb277ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Fri, 22 Oct 2004 13:09:06 +0000 Subject: [PATCH] added replicant test git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9446 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/servers/input/Jamfile | 3 +- src/tests/servers/input/replicant/Jamfile | 22 +++++++++ src/tests/servers/input/replicant/main.cpp | 49 +++++++++++++++++++ .../servers/input/replicant/replicant.rdef | 34 +++++++++++++ 4 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 src/tests/servers/input/replicant/Jamfile create mode 100644 src/tests/servers/input/replicant/main.cpp create mode 100644 src/tests/servers/input/replicant/replicant.rdef diff --git a/src/tests/servers/input/Jamfile b/src/tests/servers/input/Jamfile index 2c859573ff..82bf439788 100644 --- a/src/tests/servers/input/Jamfile +++ b/src/tests/servers/input/Jamfile @@ -1,7 +1,8 @@ SubDir OBOS_TOP src tests servers input ; SubInclude OBOS_TOP src tests servers input comm ; +SubInclude OBOS_TOP src tests servers input inputdevice ; SubInclude OBOS_TOP src tests servers input msgspy ; SubInclude OBOS_TOP src tests servers input portspy ; SubInclude OBOS_TOP src tests servers input prefs ; - +SubInclude OBOS_TOP src tests servers input replicant ; diff --git a/src/tests/servers/input/replicant/Jamfile b/src/tests/servers/input/replicant/Jamfile new file mode 100644 index 0000000000..74d7b9d004 --- /dev/null +++ b/src/tests/servers/input/replicant/Jamfile @@ -0,0 +1,22 @@ +SubDir OBOS_TOP src tests servers input replicant ; + +UseHeaders [ FDirName $(OBOS_TOP) src servers input ] ; +UsePrivateHeaders input ; +AddResources ReplicantTest : replicant.rdef ; + +if $(COMPILE_FOR_R5) { + SubDirC++Flags -DCOMPILE_FOR_R5 ; +} + +SimpleTest ReplicantTest : + MethodReplicant.cpp + MethodMenuItem.cpp + main.cpp + : be tracker ; + +SEARCH on [ FGristFiles + MethodReplicant.cpp + MethodMenuItem.cpp + ] + = [ FDirName $(OBOS_TOP) src servers input ] ; + diff --git a/src/tests/servers/input/replicant/main.cpp b/src/tests/servers/input/replicant/main.cpp new file mode 100644 index 0000000000..0af1e993d1 --- /dev/null +++ b/src/tests/servers/input/replicant/main.cpp @@ -0,0 +1,49 @@ +// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ +// +// Copyright (c) 2004, OpenBeOS +// +// This software is part of the OpenBeOS distribution and is covered +// by the OpenBeOS license. +// +// +// Program: desklink +// Author: Jérôme DUVAL +// Description: MethodReplicant Test +// Created : October 20, 2004 +// +// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + +#include +#include +#include +#include +#include "MethodReplicant.h" + +const char *app_signature = "application/x-vnd.obos.testmethodreplicant"; +// the application signature used by the replicant to find the supporting +// code + +extern "C" _EXPORT BView* instantiate_deskbar_item(); + +BView * +instantiate_deskbar_item() +{ + return new MethodReplicant(app_signature); +} + +int main(int argc, char **argv) +{ + BApplication app(app_signature); + + app_info info; + app.GetAppInfo(&info); + + status_t err = BDeskbar().AddItem(&info.ref); + + if(err!=B_OK) { + printf("desklink: Deskbar refuses link\n"); + return 1; + } + + return 0; +} diff --git a/src/tests/servers/input/replicant/replicant.rdef b/src/tests/servers/input/replicant/replicant.rdef new file mode 100644 index 0000000000..f4040f4cc4 --- /dev/null +++ b/src/tests/servers/input/replicant/replicant.rdef @@ -0,0 +1,34 @@ + +resource(1, "BEOS:APP_FLAGS") #'APPF' $"0D000000"; + +resource(1, "BEOS:APP_VERSION") #'APPV' array +{ + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000000000000000000000000000000000000000000000000000" + $"0000000000000000" +}; + +resource(1, "BEOS:APP_SIG") #'MIMS' "application/x-vnd.obos.testmethodreplicant"; + +resource(2, "BEOS:TYPE") #'MIMS' "application/x-vnd.Be-elfexecutable"; + +resource(1, "BEOS:FILE_TYPES") message;