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

« back to all changes in this revision

Viewing changes to manual-tests/misc-test-apps/con_test2.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
// ------------------------------------------------------------------------
 
2
// Copyright (C) 2009 Kai Vehmanen
 
3
//
 
4
// This program is free software; you can redistribute it and/or modify
 
5
// it under the terms of the GNU General Public License as published by
 
6
// the Free Software Foundation; either version 2 of the License, or
 
7
// (at your option) any later version.
 
8
// 
 
9
// This program is distributed in the hope that it will be useful,
 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
// GNU General Public License for more details.
 
13
// 
 
14
// You should have received a copy of the GNU General Public License
 
15
// along with this program; if not, write to the Free Software
 
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 
17
// ------------------------------------------------------------------------
 
18
 
 
19
#include <iostream>
 
20
#include <cstdio>
 
21
#include <string>
 
22
#include <cstdlib>
 
23
 
 
24
#include "ecatestsuite.h"
 
25
 
 
26
using namespace std;
 
27
 
 
28
static const string rtobject("rtnull");
 
29
static const string nonrtobject("null");
 
30
 
 
31
static void eci_execute_test(const string& cmd);
 
32
static void eci_combination_test(string arg);
 
33
 
 
34
int main(int argc, char *argv[]) {
 
35
  ECA_TEST_ENTRY();
 
36
 
 
37
  eci_combination_test("-B:auto");
 
38
  eci_combination_test("-B:nonrt");
 
39
  eci_combination_test("-B:rt");
 
40
  eci_combination_test("-B:rtlowlatency");
 
41
 
 
42
  eci_combination_test("-b:128 -z:nointbuf -z:db -r:50");
 
43
  eci_combination_test("-b:8192 -z:intbuf -z:db -r:50");
 
44
  eci_combination_test("-b:1024 -z:nodb -r:50");
 
45
 
 
46
  ECA_TEST_SUCCESS();
 
47
}
 
48
 
 
49
void eci_combination_test(string arg) {
 
50
  string ecasound_exec ("./ecasound_test");
 
51
  const char *ecasound_env = getenv("ECASOUND");
 
52
  if (ecasound_env)
 
53
    ecasound_exec = string(ecasound_env);
 
54
 
 
55
  eci_execute_test(ecasound_exec +
 
56
                   " -a:1 -i:" + rtobject + " -o:" + nonrtobject + " " + arg + " -t:2 2>/dev/null >/dev/null");
 
57
  eci_execute_test(ecasound_exec + 
 
58
                   " -a:1 -i:" + nonrtobject + " -o:" + rtobject + " " + arg + " -t:2 2>/dev/null >/dev/null");
 
59
  eci_execute_test(ecasound_exec + 
 
60
                   " -a:1 -i:" + nonrtobject + " -o:" + nonrtobject + " " + arg + " -t:2 2>/dev/null >/dev/null");
 
61
  eci_execute_test(ecasound_exec + 
 
62
                   " -a:1 -i:" + rtobject + " -o:" + rtobject + " " + arg + " -t:2 2>/dev/null >/dev/null");
 
63
}
 
64
 
 
65
void eci_execute_test(const string& cmd) {
 
66
  ECA_TEST_CASE();
 
67
 
 
68
  cout << endl << "---" << endl;
 
69
  cout << "Running test case:" << endl;
 
70
  cout << cmd << endl;
 
71
 
 
72
  if (system(cmd.c_str()) != 0) {
 
73
    ECA_TEST_FAIL(1, cmd.c_str());
 
74
  }
 
75
}