~ubuntu-branches/ubuntu/oneiric/ecasound2.2/oneiric

« back to all changes in this revision

Viewing changes to testsuite/con_test1.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Junichi Uekawa
  • Date: 2009-11-02 18:22:35 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091102182235-4ngh7699dmkgonyu
Tags: 2.7.0-1
* New upstream release.
* Depend on libreadline-dev instead of libreadline5-dev by request of
  Mattias Klose. It's now libreadline6-dev. (closes: #553748)
* Update menu file to use section Applications/ instead of Apps/.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <iostream>
2
 
#include <cstdio>
3
 
#include <string>
4
 
#include <stdlib.h>
5
 
 
6
 
#include <kvu_numtostr.h>
7
 
#include "ecatestsuite.h"
8
 
 
9
 
using namespace std;
10
 
 
11
 
static const string ecasound_exec ("./ecasound_test");
12
 
static const string input_file("foo.wav");
13
 
 
14
 
static void eci_execute_test(const string& cmd);
15
 
 
16
 
int main(int argc, char *argv[]) {
17
 
  ECA_TEST_ENTRY();
18
 
 
19
 
  eci_execute_test(ecasound_exec + " -a:1 -i " + input_file + " -gc:1,0.5 -o null -t:5 2>/dev/null >/dev/null");
20
 
  eci_execute_test(ecasound_exec + " -i:" + input_file + " -o:null -t:5 2>/dev/null >/dev/null");
21
 
  eci_execute_test(ecasound_exec + " -d:255 -z:db -r -z:nointbuf -i:" + input_file + " -o:null -t:5 2>/dev/null >/dev/null");
22
 
  eci_execute_test(ecasound_exec + "  -i:" + input_file + " -o:null -t:5 2>/dev/null >/dev/null");
23
 
  eci_execute_test(ecasound_exec + " -a:1 -i " + input_file + " -epp:0 -kf:1,0,100,0.2,0,1 -o null -t:5 2>/dev/null >/dev/null");
24
 
  eci_execute_test(ecasound_exec + " -a:1 -i " + input_file + " -efl:0 -kl:1,400,4000,10  -o null -t:5 2>/dev/null >/dev/null");
25
 
  eci_execute_test(ecasound_exec + " -a:1 -i " + input_file + " -efl:0 -kl2:1,400,4000,5,10  -o null -t:5 2>/dev/null >/dev/null");
26
 
  eci_execute_test(ecasound_exec + " -a:1 -i " + input_file + " -efl:0 -klg:1,400,4000,4,0,0.0,10,1.0,20,0.0,30,1.0  -o null -t:5 2>/dev/null >/dev/null");
27
 
  eci_execute_test(ecasound_exec + " -a:1 -i " + input_file + " -efl:0 -kog:1,400,4000,0.2,1,2,0,1,0.3,1,0.6,0  -o null -t:5 2>/dev/null >/dev/null");
28
 
  eci_execute_test(ecasound_exec + " -a:1 -i " + input_file + " -efl:400 -kos:1,200,2000,0.5,0 -o null -t:5 2>/dev/null >/dev/null");
29
 
  eci_execute_test(ecasound_exec + " -a:1 -i " + input_file + " -efl:4000.00 -ea:120.00 -efb:2000.00,4000.00 -kl:1.00,200.00,8000.00,50.00 -o null -t:5 2>/dev/null >/dev/null");
30
 
  eci_execute_test(ecasound_exec + 
31
 
                   " -f:16,1,44100 -a:bus1 -i rtnull  -eac:0,2 " +  
32
 
                   " -f:16,1,44100 -a:bus2 -i foo.wav -erc:1,2 -eac:0,1 " + 
33
 
                   " -a:bus1,bus2  -o loop,1 " +
34
 
                   " -f:16,2,44100 -a:bus3 " +
35
 
                   " -i loop,1 -f:16,1,44100 " +
36
 
                   " -o null " +
37
 
                   " -epp:50 -erm:1" +
38
 
                   " -t:5 2>/dev/null >/dev/null");
39
 
 
40
 
  string many_chains (ecasound_exec);
41
 
  many_chains += " -a:";
42
 
  for(int n = 0; n < 128; n++) {
43
 
    many_chains += kvu_numtostr(n);
44
 
    if (n != 128) many_chains += ",";
45
 
  }
46
 
  many_chains += " -i:" + input_file;
47
 
  many_chains += " -o:null -t:5 2>/dev/null >/dev/null";
48
 
  eci_execute_test(many_chains);
49
 
 
50
 
  ECA_TEST_SUCCESS();
51
 
}
52
 
 
53
 
void eci_execute_test(const string& cmd) {
54
 
  ECA_TEST_CASE();
55
 
 
56
 
  cout << endl << "---" << endl;
57
 
  cout << "Running test case:" << endl;
58
 
  cout << cmd << endl;
59
 
 
60
 
  if (system(cmd.c_str()) != 0) {
61
 
    ECA_TEST_FAIL(1, cmd.c_str());
62
 
  }
63
 
}