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

« back to all changes in this revision

Viewing changes to libecasoundc/ecicpp_tester.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
1
// ------------------------------------------------------------------------
2
2
// eca-control-interface_tester.cpp: Runs a set of ECI C++ unit tests.
3
 
// Copyright (C) 2002 Kai Vehmanen
 
3
// Copyright (C) 2002,2009 Kai Vehmanen
4
4
//
5
5
// This program is free software; you can redistribute it and/or modify
6
6
// it under the terms of the GNU General Public License as published by
36
36
 */
37
37
 
38
38
#ifdef VERBOSE
39
 
#define ECA_TEST_ENTRY()   printf("\n%s:%d - Test started", __FILE__, __LINE__)
 
39
#define ECA_TEST_ENTRY()   printf("%s:%d - Test started", __FILE__, __LINE__)
40
40
#define ECA_TEST_SUCCESS() printf("\n%s:%d - Test passed\n", __FILE__, __LINE__); return 0
41
41
#define ECA_TEST_FAIL(x,y) printf("\n%s:%d - Test failed: \"%s\"\n", __FILE__, __LINE__, y); return x
42
42
#define ECA_TEST_CASE()    printf("."); fflush(stdout)
 
43
#define ECA_TEST_TRACE(x)  do { x; } while(0)
43
44
#else
44
45
#define ECA_TEST_ENTRY()   ((void) 0)
45
46
#define ECA_TEST_SUCCESS() return 0
46
47
#define ECA_TEST_FAIL(x,y) return x
 
48
#define ECA_TEST_CASE()    ((void) 0)
 
49
#define ECA_TEST_TRACE(x)  do { ; } while(0)
47
50
#endif
48
51
 
49
52
/* --------------------------------------------------------------------- 
71
74
{
72
75
  int n, failed = 0;
73
76
  
74
 
#if NDEBUG
75
 
  const char *binpath = "ECASOUND=../ecasound/ecasound";
 
77
#ifdef NDEBUG
 
78
  const char *binpath = "ECASOUND=" TEST_TOP_BUILDDIR "/ecasound/ecasound";
76
79
#else
77
 
  const char *binpath = "ECASOUND=../ecasound/ecasound_debug";
 
80
  const char *binpath = "ECASOUND=" TEST_TOP_BUILDDIR "/ecasound/ecasound_debug";
78
81
#endif
79
82
 
 
83
  ECA_TEST_TRACE(printf("Running %s tests with %s.\n", __FILE__, binpath));
 
84
 
80
85
  putenv((char *)binpath);
81
86
 
82
87
  for(n = 0; eci_funcs[n] != NULL; n++) {