/[svn]/linuxsampler/trunk/src/testcases/LSCPTest.h
ViewVC logotype

Annotation of /linuxsampler/trunk/src/testcases/LSCPTest.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 211 - (hide annotations) (download) (as text)
Sun Jul 25 23:27:41 2004 UTC (19 years, 9 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 1516 byte(s)
* src/linuxsampler.cpp: tidied up a bit, "initialization completed"
  message shown only after the server is actually running
* src/testcases/: print the name of each test suite before running the
  tests of the suite, added first tests against the LSCP server using a
  socket connection to the LSCP server (tests for the following LSCP
  commands: "ADD CHANNEL", "GET CHANNELS", "REMOVE CHANNEL")

1 schoenebeck 211 #ifndef __LS_LSCPTEST_H__
2     #define __LS_LSCPTEST_H__
3    
4     #include <cppunit/TestFixture.h>
5     #include <cppunit/extensions/HelperMacros.h>
6    
7     #include <unistd.h>
8     #include <sys/socket.h>
9     #include <netinet/in.h>
10     #include <netinet/tcp.h>
11     #include <arpa/inet.h>
12     #include <netdb.h>
13    
14     #include <string>
15     #include <vector>
16    
17     #include "../Sampler.h"
18     #include "../network/lscpserver.h"
19    
20     using namespace std;
21    
22     class LSCPTest : public CppUnit::TestFixture {
23    
24     CPPUNIT_TEST_SUITE(LSCPTest);
25     CPPUNIT_TEST(printTestSuiteName);
26     CPPUNIT_TEST(testLaunchLSCPServer);
27     CPPUNIT_TEST(testConnectToLSCPServer);
28     CPPUNIT_TEST(test_ADD_CHANNEL);
29     CPPUNIT_TEST(test_GET_CHANNELS);
30     CPPUNIT_TEST(test_REMOVE_CHANNEL);
31     CPPUNIT_TEST(testShutdownLSCPServer);
32     CPPUNIT_TEST_SUITE_END();
33    
34     private:
35     bool launchLSCPServer();
36     bool shutdownLSCPServer();
37    
38     bool connectToLSCPServer();
39     bool closeConnectionToLSCPServer();
40    
41     void sendCommandToLSCPServer(string cmd);
42     string receiveSingleLineAnswerFromLSCPServer();
43     vector<string> receiveMultiLineAnswerFromLSCPServer();
44     string receiveAnswerFromLSCPServer(string delimiter);
45     public:
46     void setUp();
47     void tearDown();
48    
49     void printTestSuiteName();
50    
51     void testLaunchLSCPServer();
52     void testConnectToLSCPServer();
53     void test_ADD_CHANNEL();
54     void test_GET_CHANNELS();
55     void test_REMOVE_CHANNEL();
56     void testShutdownLSCPServer();
57     };
58    
59     #endif // __LS_LSCPTEST_H__

  ViewVC Help
Powered by ViewVC