Jamoma API  0.6.0.a19
DSP/extensions/EffectsLib/test.cpp
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspEffectsLib
4  *
5  * @brief Default unit test for classes in the #dspEffectsLib.
6  *
7  * @authors Timothy Place, Trond Lossius
8  *
9  * @copyright Copyright © 2013, Timothy Place @n
10  * License: This code is licensed under the terms of the "New BSD License" @n
11  * http://creativecommons.org/licenses/BSD/
12  */
13 
14 
15 #include <iostream>
16 #include "TTFoundationAPI.h"
17 
18 extern "C" TTErr TTLoadJamomaExtension_EffectsLib(void);
19 
20 int main(int argc, const char * argv[])
21 {
22  std::cout << "BEGIN testing for EffectsLib...\n";
23  TTLoadJamomaExtension_EffectsLib();
24 
25  TTValue classNames;
26 
27  // if the follow group tag is present within the thisTTClassTags definition, the class will be tested
28  TTValue testClassesWithTheseTags(TT("dspEffectsLib"));
29  TTObject::GetRegisteredClassNamesForTags(classNames, testClassesWithTheseTags);
30 
31  for (int i=0; i<classNames.size(); i++) {
32  TTSymbol name = classNames[i];
33 
34  try {
35  TTObject obj(name);
36  std::cout << "TESTING " << name.string() << std::endl;
37  obj.send("test");
38  }
39  catch (...) {
40  TTLogMessage("UnitTest Failure to instantiate object of class %s! \n", name.c_str());
41  continue;
42  }
43  }
44 
45  std::cout << "END testing of EffectsLib!\n";
46  return 0;
47 }
Create and use Jamoma object instances.
Definition: TTObject.h:29
size_type size() const noexcept
Return the number of elements.
static TTErr GetRegisteredClassNamesForTags(TTValue &classNames, const TTValue &searchTags)
Query TTEnvironment for names of all registered TTObjectBase classes that share specific tags...
Definition: TTObject.cpp:78
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
Definition: TTSymbol.h:155
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
const char * c_str() const
Return a pointer to the internal string as a C-string.
Definition: TTSymbol.h:77
void TTFOUNDATION_EXPORT TTLogMessage(TTImmutableCString message,...)
Platform and host independent method for posting log messages.
Definition: TTBase.cpp:534
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34