random ai stuff

This commit is contained in:
matst80
2025-11-21 18:12:55 +01:00
commit 60f5783a26
187 changed files with 25197 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
FILE(GLOB SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*Test.cpp" )
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common)
ADD_LIBRARY(TelldusCommonTests STATIC ${SRCS} )
TARGET_LINK_LIBRARIES( TelldusCommonTests TelldusCommon ${CPPUNIT} )
ADD_DEPENDENCIES( TelldusCommonTests TelldusCommon )

View File

@@ -0,0 +1,11 @@
#ifndef COMMONTESTS_H
#define COMMONTESTS_H
#include "StringsTest.h"
namespace CommonTests {
inline void setup() {
CPPUNIT_TEST_SUITE_REGISTRATION (StringsTest);
}
}
#endif // COMMONTESTS_H

View File

@@ -0,0 +1,16 @@
#include "StringsTest.h"
#include "Strings.h"
void StringsTest :: setUp (void)
{
}
void StringsTest :: tearDown (void)
{
}
void StringsTest :: formatfTest (void) {
CPPUNIT_ASSERT_EQUAL(std::string("42"), TelldusCore::formatf("%u", 42));
CPPUNIT_ASSERT_EQUAL(std::string("2A"), TelldusCore::formatf("%X", 42));
CPPUNIT_ASSERT_EQUAL(std::string("42"), TelldusCore::formatf("%s", "42"));
}

View File

@@ -0,0 +1,21 @@
#ifndef STRINGSTEST_H
#define STRINGSTEST_H
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
class StringsTest : public CPPUNIT_NS :: TestFixture
{
CPPUNIT_TEST_SUITE (StringsTest);
CPPUNIT_TEST (formatfTest);
CPPUNIT_TEST_SUITE_END ();
public:
void setUp (void);
void tearDown (void);
protected:
void formatfTest(void);
};
#endif //STRINGSTEST_H