Jamoma API  0.6.0.a19
DSP/library/test.cpp
1 //
2 // test.cpp
3 // JamomaDSPTest
4 //
5 // Created by Nathan Wolek on 10/2/13.
6 //
7 //
8 
9 #include <iostream>
10 #include "TTFoundationAPI.h"
11 #include "TTDSP.h"
12 
13 int main(int argc, const char * argv[])
14 {
15  std::cout << "BEGIN testing for Jamoma DSP...\n";
16  TTDSPInit();
17 
18  TTValue classNames;
19 
20  // if the follow group tag is present within the thisTTClassTags definition, the class will be tested
21  TTValue testClassesWithTheseTags(TT("dspLibrary"));
22  TTObject::GetRegisteredClassNamesForTags(classNames, testClassesWithTheseTags);
23 
24  for (int i=0; i<classNames.size(); i++) {
25  TTSymbol name = classNames[i];
26  TTObject obj(name);
27 
28  try {
29  TTObject obj(name);
30  std::cout << "TESTING " << name.string() << std::endl;
31  obj.send("test");
32  }
33  catch (...) {
34  TTLogMessage("UnitTest Failure to instantiate object of class %s! \n", name.c_str());
35  continue;
36  }
37  }
38 
39  std::cout << "END testing of Jamoma DSP!\n";
40  return 0;
41 }
42 
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
Jamoma DSP Library.
#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 TTDSP_EXPORT TTDSPInit(const char *pathToBinaries=NULL)
Initialise the Jamoma DSP library, as well as Jamoma Foundation foundation if needed.
Definition: TTDSP.cpp:30
void TTFOUNDATION_EXPORT TTLogMessage(TTImmutableCString message,...)
Platform and host independent method for posting log messages.
Definition: TTBase.cpp:534
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34