Jamoma API  0.6.0.a19
Foundation/extensions/DataspaceLib/test.cpp
1 //
2 // main.cpp
3 // JamomaTest
4 //
5 // Created by Timothy Place on 7/3/13.
6 //
7 //
8 
9 #include <iostream>
10 #include "TTFoundationAPI.h"
11 
12 extern "C" TTErr TTLoadJamomaExtension_DataspaceLib(void);
13 
14 int main(int argc, const char * argv[])
15 {
16  std::cout << "BEGIN testing for DataspaceLib...\n";
17  TTLoadJamomaExtension_DataspaceLib();
18 
19  TTValue classNames;
20 
21  // if the follow group tag is present within the thisTTClassTags definition, the class will be tested
22  TTValue testClassesWithTheseTags(TT("foundationDataspaceLib"));
23  TTObject::GetRegisteredClassNamesForTags(classNames, testClassesWithTheseTags);
24 
25  for (int i=0; i<classNames.size(); i++) {
26  TTSymbol name = classNames[i];
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  // insert code here...
40  std::cout << "END testing of DataspaceLib!\n";
41  return 0;
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
#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