git subrepo clone git@github.com:compihu/platform-test-f4-ll.git platforms/platform-test-f4-ll

subrepo:
  subdir:   "platforms/platform-test-f4-ll"
  merged:   "bc41134"
upstream:
  origin:   "git@github.com:compihu/platform-test-f4-ll.git"
  branch:   "master"
  commit:   "bc41134"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "87ee373"
This commit is contained in:
Attila Body 2021-02-24 21:46:35 +01:00
parent 46ce55c6a0
commit 95af4ce0d8
460 changed files with 84105 additions and 0 deletions

View file

@ -0,0 +1,10 @@
#include "ClassName.h"
ClassName::ClassName()
{
}
ClassName::~ClassName()
{
}

View file

@ -0,0 +1,23 @@
#ifndef D_ClassName_H
#define D_ClassName_H
///////////////////////////////////////////////////////////////////////////////
//
// ClassName is responsible for ...
//
///////////////////////////////////////////////////////////////////////////////
class ClassName
{
public:
explicit ClassName();
virtual ~ClassName();
private:
ClassName(const ClassName&);
ClassName& operator=(const ClassName&);
};
#endif // D_ClassName_H

View file

@ -0,0 +1,16 @@
#include "ClassName.h"
#include <stdlib.h>
#include <memory.h>
//static local variables
void ClassName_Create(void)
{
}
void ClassName_Destroy(void)
{
}

View file

@ -0,0 +1,12 @@
#ifndef D_ClassName_H
#define D_ClassName_H
///////////////////////////////////////////////////////////////////////////////
//
// ClassName is responsible for ...
//
///////////////////////////////////////////////////////////////////////////////
void ClassName_Create(void);
void ClassName_Destroy(void);
#endif // D_ClassName_H

View file

@ -0,0 +1,23 @@
#include "ClassName.h"
#include <stdlib.h>
#include <memory.h>
//static local variables
typedef struct _ClassName
{
int placeHolderForHiddenStructElements;
};
ClassName* ClassName_Create(void)
{
ClassName* self = malloc(sizeof(ClassName));
memset(self, 0, sizeof(ClassName));
return self;
}
void ClassName_Destroy(ClassName* self)
{
free(self);
}

View file

@ -0,0 +1,16 @@
#ifndef D_ClassName_H
#define D_ClassName_H
///////////////////////////////////////////////////////////////////////////////
//
// ClassName is responsible for ...
//
///////////////////////////////////////////////////////////////////////////////
typedef struct _ClassName Classname;
ClassName* ClassName_Create(void);
void ClassName_Destroy(ClassName*);
void ClassName_VirtualFunction_impl(ClassName*);
#endif // D_ClassName_H

View file

@ -0,0 +1,41 @@
#include "CppUTest/TestHarness.h"
static int fakeRan = 0;
extern "C"
{
#include "ClassName.h"
void virtualFunction_renameThis_fake(ClassName*)
{
fakeRan = 1;
}
}
TEST_GROUP(ClassName)
{
ClassName* aClassName;
void setup()
{
aClassName = ClassName_Create();
fakeRan = 0;
aClassName->virtualFunction_renameThis = virtualFunction_renameThis_fake;
}
void teardown()
{
ClassName_Destroy(aClassName);
}
};
TEST(ClassName, Fake)
{
aClassName->virtualFunction_renameThis(aClassName);
LONGS_EQUAL(1, fakeRan);
}
TEST(ClassName, Create)
{
FAIL("Start here");
}

View file

@ -0,0 +1,23 @@
#include "ClassName.h"
#include <stdlib.h>
#include <memory.h>
//static local variables
typedef struct _ClassName
{
int placeHolderForHiddenStructElements;
};
ClassName* ClassName_Create(void)
{
ClassName* self = malloc(sizeof(ClassName));
memset(self, 0, sizeof(ClassName));
return self;
}
void ClassName_Destroy(ClassName* self)
{
free(self);
}

View file

@ -0,0 +1,18 @@
#ifndef D_ClassName_H
#define D_ClassName_H
///////////////////////////////////////////////////////////////////////////////
//
// ClassName is responsible for ...
//
///////////////////////////////////////////////////////////////////////////////
typedef struct _ClassName ClassnamePiml;
ClassName* ClassName_Create(void);
void ClassName_Destroy(ClassName*);
void ClassName_VirtualFunction_impl(ClassName*);
#endif // D_ClassName_H

View file

@ -0,0 +1,25 @@
#include "CppUTest/TestHarness.h"
extern "C"
{
#include "ClassName.h"
}
TEST_GROUP(ClassName)
{
void setup()
{
ClassName_Create();
}
void teardown()
{
ClassName_Destroy();
}
};
TEST(ClassName, Create)
{
FAIL("Start here");
}

View file

@ -0,0 +1,33 @@
#include <cppunit/config/SourcePrefix.h>
#include <cppunit/extensions/HelperMacros.h>
#include "ClassName.h"
class ClassNameTest: public CPPUNIT_NS::TestFixture
{
CPPUNIT_TEST_SUITE(ClassNameTest);
CPPUNIT_TEST(testCreate);
CPPUNIT_TEST_SUITE_END();
ClassName* aClassName;
public:
void setUp()
{
aClassName = new ClassName();
}
void tearDown()
{
delete aClassName;
}
void testCreate()
{
CPPUNIT_FAIL("Start here");
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(ClassNameTest);

View file

@ -0,0 +1,24 @@
#include "CppUTest/TestHarness.h"
extern "C"
{
#include "FakeClassName.h"
}
TEST_GROUP(FakeClassName)
{
void setup()
{
ClassName_Create();
}
void teardown()
{
ClassName_Destroy();
}
};
TEST(FakeClassName, Create)
{
FAIL("Start here");
}

View file

@ -0,0 +1,34 @@
#include <cppunit/config/SourcePrefix.h>
#include <cppunit/extensions/HelperMacros.h>
#include "ClassName.h"
#include "MockClassName.h"
class MockClassNameTest: public CPPUNIT_NS::TestFixture
{
CPPUNIT_TEST_SUITE(MockClassNameTest);
CPPUNIT_TEST(testCreate);
CPPUNIT_TEST_SUITE_END();
ClassName* aClassName;
MockClassName* mockClassName;
public:
void setUp()
{
mockClassName = new MockClassName();
aClassName = mockClassName;
}
void tearDown()
{
delete aClassName;
}
void testCreate()
{
CPPUNIT_FAIL("Start here");
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(MockClassNameTest);

View file

@ -0,0 +1,29 @@
#ifndef D_MockClassName_H
#define D_MockClassName_H
///////////////////////////////////////////////////////////////////////////////
//
// MockClassName.h
//
// MockClassName is responsible for providing a test stub for ClassName
//
///////////////////////////////////////////////////////////////////////////////
#include "ClassName.h"
class MockClassName : public ClassName
{
public:
explicit MockClassName()
{}
virtual ~MockClassName()
{}
private:
MockClassName(const MockClassName&);
MockClassName& operator=(const MockClassName&);
};
#endif // D_MockClassName_H

View file

@ -0,0 +1,16 @@
#include "ClassName.h"
#include <stdlib.h>
#include <memory.h>
//static local variables
void ClassName_Create(void)
{
}
void ClassName_Destroy(void)
{
}

View file

@ -0,0 +1,13 @@
#ifndef D_FakeClassName_H
#define D_FakeClassName_H
///////////////////////////////////////////////////////////////////////////////
//
// FakeClassName.h
//
// FakeClassName is responsible for providing a test stub for ClassName
//
///////////////////////////////////////////////////////////////////////////////
#include "ClassName.h"
#endif // D_FakeClassName_H

View file

@ -0,0 +1,48 @@
#Set this to @ to keep the makefile quiet
SILENCE = @
#---- Outputs ----#
COMPONENT_NAME = Project
TARGET_LIB = \
lib/lib$(COMPONENT_NAME).a
TEST_TARGET = \
$(COMPONENT_NAME)_tests
#--- Inputs ----#
PROJECT_HOME_DIR = .
CPPUTEST_HOME = ../CppUTest
CPPUNIT_HOME = ../cppunit
CPP_PLATFORM = Gcc
#CFLAGS are set to override malloc and free to get memory leak detection in C programs
CFLAGS = -Dmalloc=cpputest_malloc -Dfree=cpputest_free
CPPFLAGS =
#GCOVFLAGS = -fprofile-arcs -ftest-coverage
#SRC_DIRS is a list of source directories that make up the target library
#If test files are in these directories, their IMPORT_TEST_GROUPs need
#to be included in main to force them to be linked in. By convention
#put them into an AllTests.h file in each directory
SRC_DIRS = \
src/util
#TEST_SRC_DIRS is a list of directories including
# - A test main (AllTests.cpp by convention)
# - OBJ files in these directories are included in the TEST_TARGET
# - Consequently - AllTests.h containing the IMPORT_TEST_GROUPS is not needed
# -
TEST_SRC_DIRS = \
tests \
tests/util
#includes for all compiles
INCLUDES =\
-I.\
-Iinclude/util\
-I$(CPPUTEST_HOME)/include/
#Flags to pass to ld
LDFLAGS += $(CPPUNIT_HOME)/lib/libcppunit.a
include $(CPPUTEST_HOME)/build/ComponentMakefile

View file

@ -0,0 +1,28 @@
#ifndef D_ProjectBuildTime_H
#define D_ProjectBuildTime_H
///////////////////////////////////////////////////////////////////////////////
//
// ProjectBuildTime is responsible for recording and reporting when
// this project library was built
//
///////////////////////////////////////////////////////////////////////////////
class ProjectBuildTime
{
public:
explicit ProjectBuildTime();
virtual ~ProjectBuildTime();
const char* GetDateTime();
private:
const char* dateTime;
ProjectBuildTime(const ProjectBuildTime&);
ProjectBuildTime& operator=(const ProjectBuildTime&);
};
#endif // D_ProjectBuildTime_H

View file

@ -0,0 +1,16 @@
#include "ProjectBuildTime.h"
ProjectBuildTime::ProjectBuildTime()
: dateTime(__DATE__ " " __TIME__)
{
}
ProjectBuildTime::~ProjectBuildTime()
{
}
const char* ProjectBuildTime::GetDateTime()
{
return dateTime;
}

View file

@ -0,0 +1,8 @@
#include "CppUTest/CommandLineTestRunner.h"
int main(int ac, char** av)
{
return CommandLineTestRunner::RunAllTests(ac, av);
}

View file

@ -0,0 +1,22 @@
#include "CppUTest/TestHarness.h"
#include "ProjectBuildTime.h"
TEST_GROUP(ProjectBuildTime)
{
ProjectBuildTime* projectBuildTime;
void setup()
{
projectBuildTime = new ProjectBuildTime();
}
void teardown()
{
delete projectBuildTime;
}
};
TEST(ProjectBuildTime, Create)
{
CHECK(0 != projectBuildTime->GetDateTime());
}