]> www.vanbest.org Git - sasc-ng.git/commitdiff
add externalAU testing
authorleslie <unknown>
Mon, 11 Aug 2008 09:14:31 +0000 (17:14 +0800)
committerleslie <unknown>
Mon, 11 Aug 2008 09:14:31 +0000 (17:14 +0800)
data.h
testing/Makefile
testing/testExtAU.c [new file with mode: 0644]

diff --git a/data.h b/data.h
index 3318e4b3d551cce14bc0c41b299fcba10671dd01..8065f9101876081d4fbfba30fe25081c9d1e419d 100644 (file)
--- a/data.h
+++ b/data.h
@@ -354,6 +354,9 @@ public:
   bool NewKey(int Type, int Id, int Keynr, void *Key, int Keylen);
   bool NewKeyParse(char *line, const char *reason);
   void HouseKeeping(void);
+#ifdef TESTER
+  void TestExternalUpdate(void);
+#endif
   };
 
 extern cPlainKeys keys;
index 3f5074b6a4a83a2796f818e7765760fdb2903254..fe3e178855cddf3fd3f7e05b2781bc89dc9fe678 100644 (file)
@@ -40,7 +40,7 @@ $(VDRDIR)/%.o: $(VDRDIR)/%.c
 
 ### Targets:
 
-all: testECM testEMM testN1Emu testN2Emu testN2RunEmu
+all: testECM testEMM testN1Emu testN2Emu testN2RunEmu testTPS testExtAU
 
 testECM.o: testECM.c compat.h
 testECM: testECM.o $(SHAREDOBJS) $(NOBJS)
@@ -68,6 +68,10 @@ testTPS.o: testTPS.c ../systems/viaccess/tps.c ../systems/viaccess/st20.c ../sys
 testTPS: testTPS.o $(SHAREDOBJS) $(NOBJS)
        $(CXX) $(CXXFLAGS) $^ $(LIBS) -o $@
 
+testExtAU.o: testExtAU.c compat.h
+testExtAU: testExtAU.o $(SHAREDOBJS) $(NOBJS)
+       $(CXX) $(CXXFLAGS) -rdynamic $^ $(LIBS) -o $@
+
 filterhelper: filterhelper.o
        $(CXX) $(CXXFLAGS) $^ -o $@
 clean:
diff --git a/testing/testExtAU.c b/testing/testExtAU.c
new file mode 100644 (file)
index 0000000..c375d97
--- /dev/null
@@ -0,0 +1,34 @@
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#define TESTER
+#include "data.h"
+#include "scsetup.h"
+#include "compat.h"
+
+void cPlainKeys::TestExternalUpdate(void)
+{
+  Lock();
+  Start();
+  Unlock();
+  while(Active()) {
+   printf("."); fflush(stdout);
+   cCondWait::SleepMs(600);
+   }
+}
+
+int main(int argc, char *argv[])
+{
+  if(argc<3) {
+    printf("usage: %s <lib-dir> <plugin-dir> <extau>\n",argv[0]);
+    return 1;
+    }
+  DllsLoad(argv[1]);
+  InitAll(argv[2]);
+  LogAll();
+
+  ScSetup.AutoUpdate=1;
+  externalAU=argv[3];
+  keys.TestExternalUpdate();
+}