RUNNER_TEST_GROUP_INIT(DPL)
+/*
+Name: Address_InitialEmpty
+Description: tests empty constructor of DPL::Address
+Expected: string version of empy address equals ":0"
+*/
RUNNER_TEST(Address_InitialEmpty)
{
DPL::Address address;
RUNNER_ASSERT(address.ToString() == ":0");
}
+/*
+Name: Address_InitialAddress
+Description: tests constructor of DPL::Address with name only
+Expected: string version of address equals given name and appended ":0"
+*/
RUNNER_TEST(Address_InitialAddress)
{
DPL::Address address("www.sample.com");
RUNNER_ASSERT(address.ToString() == "www.sample.com:0");
}
+/*
+Name: Address_InitialAddress
+Description: tests constructor of DPL::Address with name and port
+Expected: string version of address should look lik "adress name:port"
+*/
RUNNER_TEST(Address_InitialAddressPort)
{
DPL::Address address("www.somewhere.com", 8080);
RUNNER_ASSERT(address.ToString() == "www.somewhere.com:8080");
}
+/*
+Name: Address_InitialAddress
+Description: tests getter of address
+Expected: address name and port should matches those passed in constructor
+*/
RUNNER_TEST(Address_Getters)
{
DPL::Address address("www.somewhere.com", 8080);
return result;
}
+/*
+Name: BinaryQueue_InitialEmpty
+Description: tests emptiness of new constructed queue
+Expected: new queue should be empty
+*/
RUNNER_TEST(BinaryQueue_InitialEmpty)
{
DPL::BinaryQueue queue;
RUNNER_ASSERT(queue.Empty() == true);
}
+/*
+Name: BinaryQueue_InitialSize
+Description: tests emptiness of new constructed queue
+Expected: new queue size should be equal 0
+*/
RUNNER_TEST(BinaryQueue_InitialSize)
{
DPL::BinaryQueue queue;
RUNNER_ASSERT(queue.Size() == 0);
}
+/*
+Name: BinaryQueue_InitialCopy
+Description: tests emptiness of new copy-constructed empty queue
+Expected: queue constructed on base on empty queue should be empty
+*/
RUNNER_TEST(BinaryQueue_InitialCopy)
{
DPL::BinaryQueue queue;
RUNNER_ASSERT(copy.Size() == 0);
}
+/*
+Name: BinaryQueue_InitialConsumeZero
+Description: tests consume method accepts 0 bytes
+Expected: it should be avaliable to discard 0 bytes from empty queue
+*/
RUNNER_TEST(BinaryQueue_InitialConsumeZero)
{
DPL::BinaryQueue queue;
queue.Consume(0);
}
+/*
+Name: BinaryQueue_InitialFlattenConsumeZero
+Description: tests returning data from queue and discarding
+Expected: it should be able to call flattenconsume with empty buffer if 0 bytes are read
+*/
RUNNER_TEST(BinaryQueue_InitialFlattenConsumeZero)
{
DPL::BinaryQueue queue;
queue.FlattenConsume(NULL, 0);
}
+/*
+Name: BinaryQueue_InitialFlattenZero
+Description: tests returning data from queue
+Expected: it should be able to call flatten with empty buffer if 0 bytes are read
+*/
RUNNER_TEST(BinaryQueue_InitialFlattenZero)
{
DPL::BinaryQueue queue;
queue.Flatten(NULL, 0);
}
+/*
+Name: BinaryQueue_InitialConsumeOne
+Description: tests discarding more bytes than it is avaliable
+Expected: exception throw
+*/
RUNNER_TEST(BinaryQueue_InitialConsumeOne)
{
DPL::BinaryQueue queue;
RUNNER_FAIL;
}
+/*
+Name: BinaryQueue_InitialFlattenConsumeOne
+Description: tests reading and discarding more bytes than it is avaliable
+Expected: exception throw
+*/
RUNNER_TEST(BinaryQueue_InitialFlattenConsumeOne)
{
DPL::BinaryQueue queue;
RUNNER_FAIL;
}
+/*
+Name: BinaryQueue_InitialFlattenOne
+Description: tests reading more bytes than it is avaliable
+Expected: exception throw
+*/
RUNNER_TEST(BinaryQueue_InitialFlattenOne)
{
DPL::BinaryQueue queue;
RUNNER_FAIL;
}
+/*
+Name: BinaryQueue_ZeroCopyFrom
+Description: tests coping content of empty queue to another (AppendCopyFrom)
+Expected: source queue should be empty
+*/
RUNNER_TEST(BinaryQueue_ZeroCopyFrom)
{
DPL::BinaryQueue queue;
RUNNER_ASSERT(queue.Empty());
}
+/*
+Name: BinaryQueue_ZeroMoveFrom
+Description: tests moving content of empty queue to another
+Expected: source queue should be empty
+*/
RUNNER_TEST(BinaryQueue_ZeroMoveFrom)
{
DPL::BinaryQueue queue;
RUNNER_ASSERT(queue.Empty());
}
+/*
+Name: BinaryQueue_ZeroCopyTo
+Description: tests moving content of empty queue to another (AppendCopyTo)
+Expected: source queue should be empty
+*/
RUNNER_TEST(BinaryQueue_ZeroCopyTo)
{
DPL::BinaryQueue queue;
RUNNER_ASSERT(queue.Empty());
}
+/*
+Name: BinaryQueue_InsertSingleCharacters
+Description: tests inserting single bytes to queue
+Expected: stringified content and size shoudl match expected
+*/
RUNNER_TEST(BinaryQueue_InsertSingleCharacters)
{
DPL::BinaryQueue queue;
RUNNER_ASSERT(BinaryQueueToString(queue) == "abcd");
}
+/*
+Name: BinaryQueue_Consume
+Description: tests comsuming portions of 1 or 2 bytes
+Expected: stringified content and size should match expected
+ Bytes should be pope from begin.
+*/
RUNNER_TEST(BinaryQueue_Consume)
{
DPL::BinaryQueue queue;
RUNNER_ASSERT(BinaryQueueToString(queue) == "");
}
+/*
+Name: BinaryQueue_Flatten
+Description: tests comsuming portions of 1 and more bytes
+Expected: stringified content and size should match expected
+*/
RUNNER_TEST(BinaryQueue_Flatten)
{
DPL::BinaryQueue queue;
RUNNER_ASSERT(BinaryQueueToString(queue) == "abcdefg");
}
+/*
+Name: BinaryQueue_FlattenConsume
+Description: tests comsuming portions of 1 and more bytes
+Expected: stringified content and size should match expected
+ reading and discarding bytes should affect queue's size and content
+*/
RUNNER_TEST(BinaryQueue_FlattenConsume)
{
DPL::BinaryQueue queue;
RUNNER_ASSERT(BinaryQueueToString(queue) == "def");
}
+/*
+Name: BinaryQueue_AppendCopyFrom
+Description: tests creating copy of not empty queue (use of: AppendCopyFrom)
+Expected: stringified content and size should match expected
+ from original queue and it's copy
+*/
RUNNER_TEST(BinaryQueue_AppendCopyFrom)
{
DPL::BinaryQueue queue;
RUNNER_ASSERT(BinaryQueueToString(copy) == "abcdef");
}
+/*
+Name: BinaryQueue_AppendCopyTo
+Description: tests creating copy of not empty queue (use of: AppendCopyTo)
+Expected: stringified content and size should match expected
+ from original queue and it's copy
+*/
RUNNER_TEST(BinaryQueue_AppendCopyTo)
{
DPL::BinaryQueue queue;
RUNNER_ASSERT(BinaryQueueToString(copy) == "abcdef");
}
+/*
+Name: BinaryQueue_AppendMoveFrom
+Description: tests moving content of not empty queue (use of: AppendMoveFrom)
+Expected: stringified content and size should match expected
+ for new queue. Old queue should be empty after operation
+*/
RUNNER_TEST(BinaryQueue_AppendMoveFrom)
{
DPL::BinaryQueue queue;
RUNNER_ASSERT(BinaryQueueToString(copy) == "abcdef");
}
+/*
+Name: BinaryQueue_AppendMoveFrom
+Description: tests moving content of not empty queue (use of: AppendMoveTo)
+Expected: stringified content and size should match expected
+ for new queue. Old queue should be empty after operation
+*/
RUNNER_TEST(BinaryQueue_AppendMoveTo)
{
DPL::BinaryQueue queue;
}
};
+/*
+Name: BinaryQueue_Visitor
+Description: tests byte by byte content of queue by use of visitor
+Expected: stringified content and size should match expected
+ Each byte should be at right position
+*/
RUNNER_TEST(BinaryQueue_Visitor)
{
DPL::BinaryQueue queue;
RUNNER_ASSERT(queue.Size() == 0);
}
+/*
+Name: BinaryQueue_AbstracOutputWrite
+Description: tests appending one queue to another
+Expected: written bytes shoudl affect content and size of queue
+*/
RUNNER_TEST(BinaryQueue_AbstracOutputWrite)
{
DPL::BinaryQueue queue;
}
};
+/*
+Name: FastDelegate_Test
+Description: tests several scenarios of using fast delegates
+Expected: function calls succeeded
+*/
RUNNER_TEST(FastDelegate_Test)
{
// Delegates with up to 8 parameters are supported.
return set;
}
+/*
+Name: Foreach_std_containers
+Description: tests iterating contianers set, list, vector using foreach
+Expected: value supplied by foreach matches sequence of integers
+*/
RUNNER_TEST(Foreach_std_containers)
{
std::vector<size_t> vector;
}
};
+/*
+Name: Log_Unknown_Exception
+Description: tests exceptions catching macros
+Expected: unknown exception should be catched
+
+TODO: workaround abort call
+*/
RUNNER_TEST(Log_Unknown_Exception)
{
UNHANDLED_EXCEPTION_HANDLER_BEGIN
RUNNER_ASSERT(true);
}
+/*
+Name: Log_DPL_Exception
+Description: tests exceptions catching macros
+Expected: DPL exception should be catched
+
+TODO: workaround abort call
+*/
RUNNER_TEST(Log_DPL_Exception)
{
UNHANDLED_EXCEPTION_HANDLER_BEGIN
RUNNER_ASSERT(true);
}
+/*
+Name: Log_STD_Exception
+Description: tests exceptions catching macros
+Expected: STD exception should be catched
+
+TODO: workaround abort call
+*/
RUNNER_TEST(Log_STD_Exception)
{
UNHANDLED_EXCEPTION_HANDLER_BEGIN
DPL::Atomic *m_atom;
};
+/*
+Name: Once_MultiThreadCall
+Description: tests once call wrapper for use by multiple threads
+Expected: function should be called just once from one of running threads
+*/
RUNNER_TEST(Once_MultiThreadCall)
{
const size_t NUM_THREADS = 20;
RUNNER_TEST_GROUP_INIT(DPL)
+/*
+Name: ScopedArray_Zero
+Description: tests emptiness of empty scoped array
+Expected: array should be empty
+*/
RUNNER_TEST(ScopedArray_Zero)
{
DPL::ScopedArray<char> array;
RUNNER_ASSERT(!!!array);
}
+/*
+Name: ScopedArray_NonZero
+Description: tests emptiness of not empty scoped array
+Expected: array should be not empty
+*/
RUNNER_TEST(ScopedArray_NonZero)
{
DPL::ScopedArray<char> array(new char[7]);
RUNNER_ASSERT(!!array);
}
+/*
+Name: ScopedArray_Reset
+Description: tests reseting content of array
+Expected: array should be empty after reset
+*/
RUNNER_TEST(ScopedArray_Reset)
{
DPL::ScopedArray<char> array(new char[7]);
RUNNER_ASSERT(array);
}
+/*
+Name: ScopedArray_ArrayOperator
+Description: tests accessing elements of array
+Expected: returned values should be equal to those which were set
+*/
RUNNER_TEST(ScopedArray_ArrayOperator)
{
DPL::ScopedArray<char> array(new char[7]);
}
} //anonymous namespace
+/*
+Name: ScopedFClose_Zero
+Description: tests if operator ! works correct for closed file
+Expected: file should be closed
+*/
RUNNER_TEST(ScopedFClose_Zero)
{
DPL::ScopedFClose file;
RUNNER_ASSERT(!!!file);
}
+/*
+Name: ScopedArray_NonZero
+Description: tests if operator ! works correct for open file
+Expected: file should be open
+*/
RUNNER_TEST(ScopedFClose_NonZero)
{
DPL::ScopedFClose file(MakeTmp());
RUNNER_ASSERT(!!file);
}
+/*
+Name: ScopedFClose_Reset
+Description: tests reseting of scoped file
+Expected: file should be closed after reset
+*/
RUNNER_TEST(ScopedFClose_Reset)
{
DPL::ScopedFClose file(MakeTmp());
RUNNER_TEST_GROUP_INIT(DPL)
+/*
+Name: ScopedFree_Zero
+Description: Checks emptiness of not set scoped free
+Expected: resource should be freed
+*/
RUNNER_TEST(ScopedFree_Zero)
{
DPL::ScopedFree<void> free;
RUNNER_ASSERT(!!!free);
}
+/*
+Name: ScopedFree_NonZero
+Description: Checks emptiness of set scoped free
+Expected: resource should not be reported as freed
+*/
RUNNER_TEST(ScopedFree_NonZero)
{
DPL::ScopedFree<void> free(malloc(7));
RUNNER_ASSERT(!!free);
}
+/*
+Name: ScopedFree_Reset
+Description: Checks reseting scoped free
+Expected: resource should be freed after reset
+*/
RUNNER_TEST(ScopedFree_Reset)
{
DPL::ScopedFree<void> free(malloc(7));
RUNNER_TEST_GROUP_INIT(DPL)
+/*
+Name: ScopedPtr_Zero
+Description: Checks if operator! works
+Expected: resource should be not set
+*/
RUNNER_TEST(ScopedPtr_Zero)
{
DPL::ScopedPtr<char> ptr;
RUNNER_ASSERT(!!!ptr);
}
+/*
+Name: ScopedPtr_NonZero
+Description: Checks if operator! works
+Expected: resource should be set
+*/
RUNNER_TEST(ScopedPtr_NonZero)
{
DPL::ScopedPtr<char> ptr(new char(7));
RUNNER_ASSERT(!!ptr);
}
+/*
+Name: ScopedPtr_Reset
+Description: Checks reseting scoped ptr
+Expected: resource should be not set after reset
+*/
RUNNER_TEST(ScopedPtr_Reset)
{
DPL::ScopedPtr<char> ptr(new char(7));
RUNNER_ASSERT(ptr);
}
+/*
+Name: ScopedPtr_Operators
+Description: Checks access operator
+Expected: address of resource should be same as this, received from Get() method
+*/
RUNNER_TEST(ScopedPtr_Operators)
{
DPL::ScopedPtr<char> ptr(new char(7));
}
};
+/*
+Name: Semaphore_NamedIncrementDecrement
+Description: Checks if semaphore are working
+Expected: value should not change after all
+*/
RUNNER_TEST(Semaphore_NamedIncrementDecrement)
{
std::string semaphoreName =
std::vector<std::string> c;
};
+/*
+Name: Serialize_primitives
+Description: Tests serialization of primitives types
+Expected: serialized value after deserialization
+ should be equal to deserialied value
+*/
RUNNER_TEST(Serialize_primitives)
{
int a = 1;
RUNNER_ASSERT(test_unsigned == c);
}
+/*
+Name: Serialize_primitive_pointers
+Description: Tests serialization of primitives pointer types
+Expected: serialized value after deserialization
+ should be equal to deserialied value
+*/
RUNNER_TEST(Serialize_primitive_pointers)
{
int a = 1;
delete test_unsigned;
}
+/*
+Name: Serialize_strings
+Description: Tests serialization of strings
+Expected: serialized value after deserialization
+ should be equal to deserialied value
+*/
RUNNER_TEST(Serialize_strings)
{
std::string str1 = "ALA MA KOTA";
RUNNER_ASSERT(test_str2 == str2);
}
+/*
+Name: Serialize_string_pointers
+Description: Tests serialization of string pointers
+Expected: serialized value after deserialization
+ should be equal to deserialied value
+*/
RUNNER_TEST(Serialize_string_pointers)
{
std::string str1 = "ALA MA KOTA";
delete test_str2;
}
+/*
+Name: Serialize_containers
+Description: Tests serialization of containers
+Expected: serialized value after deserialization
+ should be equal to deserialied value
+*/
RUNNER_TEST(Serialize_containers)
{
std::vector<int> vec;
test_map.at(-78) == map.at(-78));
}
+/*
+Name: Serialize_objects
+Description: Tests serialization of DPL::ISerializable derived objects
+Expected: serialized value after deserialization
+ should be equal to deserialied value
+*/
RUNNER_TEST(Serialize_objects)
{
TestClass a(123, "ASDGHUADB\n\n5679b^^()*", "TEST_STRING"),
RUNNER_ASSERT(test_b == b);
}
+/*
+Name: Serialize_all
+Description: Tests serialization of compound objects
+Expected: serialized value after deserialization
+ should be equal to deserialied value
+*/
RUNNER_TEST(Serialize_all)
{
std::map<std::string, std::vector<TestClass*> > map;
RUNNER_TEST_GROUP_INIT(DPL)
+/*
+Name: SharedPtr_Zero
+Description: Tests behaviour of null shared pointer
+Expected: pointer should imitate null pointer
+*/
RUNNER_TEST(SharedPtr_Zero)
{
DPL::SharedPtr<char> ptr;
RUNNER_ASSERT(ptr == DPL::SharedPtr<char>());
}
+/*
+Name: SharedPtr_NonZero
+Description: Tests behaviour of not null shared pointer
+Expected: pointer should imitate null pointer
+*/
RUNNER_TEST(SharedPtr_NonZero)
{
DPL::SharedPtr<char> ptr(new char(7));
RUNNER_ASSERT(ptr != DPL::SharedPtr<char>());
}
+/*
+Name: SharedPtr_Copy
+Description: Tests equality of shared pointer pointing same resource
+Expected: pointers should imitate primitive pointer bahaviour
+*/
RUNNER_TEST(SharedPtr_Copy)
{
DPL::SharedPtr<char> ptr1(new char(7));
RUNNER_ASSERT(ptr1 == ptr2);
}
+/*
+Name: SharedPtr_Reset
+Description: Tests reseting shared pointer
+Expected: pointers should imitate primitive pointer bahaviour after reset
+*/
RUNNER_TEST(SharedPtr_Reset)
{
DPL::SharedPtr<char> ptr(new char(7));
RUNNER_ASSERT(ptr);
}
+/*
+Name: SharedPtr_RefCounting
+Description: Tests use count od shared pointer
+Expected: counters should be equal for equal pointers
+ Count number should match expected
+*/
RUNNER_TEST(SharedPtr_RefCounting)
{
DPL::SharedPtr<char> ptr1(new char(7));
RUNNER_ASSERT(ptr1.GetUseCount() == 2);
}
+/*
+Name: SharedPtr_Operators
+Description: Tests use of operator*
+Expected: pointers should imitate primitive pointer bahaviour
+*/
RUNNER_TEST(SharedPtr_Operators)
{
DPL::SharedPtr<char> ptr(new char(7));
AAAAaQAAAGoAAABrAAAAbAAAAG0AAABuAAAAbwAAAHAAAABxAAAAcgAAAHMAAAB0AAAAdQAAAHYA\
AAB3AAAAeAAAAHkAAAB6AAAAewAAAHwAAAB9AAAAfgAAAAAAAAA=";
+/*
+Name: String_ConverterFromASCII
+Description: tests construction of string from ascii data
+Expected: data stored in buffer should match expected
+*/
RUNNER_TEST(String_ConverterFromASCII)
{
char* inStr = NULL;
free(inStr);
}
+/*
+Name: String_ConverterFromUTF8
+Description: tests construction of string from UTF-8 data
+Expected: data stored in buffer should match expected
+*/
RUNNER_TEST(String_ConverterFromUTF8)
{
char* inStr = NULL;
free(inStr);
}
+/*
+Name: String_ConverterFromUTF32
+Description: tests construction of string from UTF-32 data
+Expected: data stored in buffer should match expected
+*/
RUNNER_TEST(String_ConverterFromUTF32)
{
wchar_t* inStr = NULL;
RUNNER_ASSERT(expectedTokens == tokens);
}
+/*
+Name: String_Tokenize
+Description: tests of string splitting
+Expected: returned substring should match expected values
+*/
RUNNER_TEST(String_Tokenize)
{
String_TokenizeReal(L"#.");
RUNNER_ASSERT(ostream.str() == argumentResultString);
}
+/*
+Name: String_Streams
+Description: tests of input/output stream
+Expected: returned substrign should match expected values
+*/
RUNNER_TEST(String_Streams)
{
TestInStreams<std::char_traits<char> >("1 1.1 1.1 test", "test");
TestOutStreams<DPL::CharTraits>(L"test", L"11.11.1test");
}
+/*
+Name: String_CompareCaseSensitive
+Description: tests case sensitive comparision
+Expected: strings should be equal
+*/
RUNNER_TEST(String_CompareCaseSensitive)
{
RUNNER_ASSERT(
DPL::FromUTF32String(L"Ala Makota ma żołądkówkę")) == 0);
}
+/*
+Name: String_CompareCaseInsensitive
+Description: tests case insensitive comparision
+Expected: strings should be equal
+*/
RUNNER_TEST(String_CompareCaseInsensitive)
{
RUNNER_ASSERT(
}
};
+/*
+Name: Thread_ThreadLocalVariable_FooDeletion
+Description: tests local thread variable pattern
+Expected: local thread variables should not be affected by other threads
+*/
RUNNER_TEST(Thread_ThreadLocalVariable_FooDeletion)
{
static TlsFoo staticFooForMain;
RUNNER_TEST_GROUP_INIT(DPL)
+/*
+Name: TypeList_TypeCount
+Description: tests size of typelist idiom
+Expected: size should match
+*/
RUNNER_TEST(TypeList_TypeCount)
{
typedef DPL::TypeListDecl<int, char, int[64]>::Type TestTypeList1;
RUNNER_TEST_GROUP_INIT(DPL)
+/*
+Name: ZipInput_OpenFailed
+Description: tests opening non existing file
+Expected: exception throw
+*/
RUNNER_TEST(ZipInput_OpenFailed)
{
bool opened = true;
RUNNER_ASSERT(opened == false);
}
+/*
+Name: ZipInput_OpenFile
+Description: tests opening existing file
+Expected: zip stats should mkatch expected
+*/
RUNNER_TEST(ZipInput_OpenFile)
{
DPL::ZipInput zip(PATH_ARCHIVE);
}
}
+/*
+Name: ZipInput_UnzipSingleFile
+Description: tests opening existing file and unzipping single file
+Expected: right content
+*/
RUNNER_TEST(ZipInput_UnzipSingleFile)
{
DPL::ZipInput zip(PATH_ARCHIVE);
RUNNER_TEST_GROUP_INIT(DPL)
+/*
+Name: ORM_SelectSingleValue
+Description: tests quering single value of single row from database
+Expected: Values should match those which were prepared
+*/
RUNNER_TEST(ORM_SelectSingleValue)
{
SmartAttach interface;
}
}
+/*
+Name: ORM_SelectSingleRow
+Description: tests quering single row from database
+Expected: Values should match those which were prepared
+*/
RUNNER_TEST(ORM_SelectSingleRow)
{
SmartAttach interface;
}
}
+/*
+Name: ORM_SelectRowList
+Description: tests quering multiple row from database
+Expected: Values should match those which were prepared
+*/
RUNNER_TEST(ORM_SelectRowList)
{
SmartAttach interface;
}
}
+/*
+Name: ORM_SelectValueList
+Description: tests quering single column from multiple row from database
+Expected: Values should match those which were prepared
+*/
RUNNER_TEST(ORM_SelectValueList)
{
SmartAttach interface;
}
}
+/*
+Name: ORM_MultipleCalls
+Description: tests sequnece of different queries
+Expected: Values should match those which were prepared
+*/
RUNNER_TEST(ORM_MultipleCalls)
{
for (int j = 0; j < TEST_REPETITION; j++) {
}
}
+/*
+Name: ORM_Insert
+Description: tests insering rows into database
+Expected: Values should be inserted
+*/
RUNNER_TEST(ORM_Insert)
{
SmartAttach interface;
}
}
+/*
+Name: ORM_MultipleBindInsert
+Description: repeats ORM_Insert test several times
+Expected: Values should be inserted
+*/
RUNNER_TEST(ORM_MultipleBindInsert)
{
for (int i = 0; i < TEST_REPETITION; i++) {
}
}
+/*
+Name: ORM_Delete
+Description: tests deleting rows from database
+Expected: deleted rows should not exist
+*/
RUNNER_TEST(ORM_Delete)
{
SmartAttach interface;
}
}
+/*
+Name: ORM_MultipleBindDelete
+Description: repeats ORM_Delete test several times
+Expected: Values should be deleted
+*/
RUNNER_TEST(ORM_MultipleBindDelete)
{
for (int i = 0; i < TEST_REPETITION; i++) {
}
}
+/*
+Name: ORM_MultipleBindWhere
+Description: tests if multiple bind of same query obejct works
+Expected: Each bind and execution of query should be correct
+*/
RUNNER_TEST(ORM_MultipleBindWhere)
{
SmartAttach interface;
}
}
+/*
+Name: ORM_Update
+Description: tests rows update in database
+Expected: Successful update
+*/
RUNNER_TEST(ORM_Update)
{
SmartAttach interface;
}
}
+/*
+Name: ORM_MultipleBindUpdate
+Description: repeats ORM_Update severl times
+Expected: Successful update
+*/
RUNNER_TEST(ORM_MultipleBindUpdate)
{
for (int i = 0; i < TEST_REPETITION; i++) {
}
}
+/*
+Name: ORM_transactions
+Description: checks creation of transation object
+Expected: Successful creation of transaction object
+*/
RUNNER_TEST(ORM_transactions)
{
SmartAttach interface;
DPL::DB::ORM::dpl_orm_test::ScopedTransaction transaction(interface.get());
}
+/*
+Name: ORM_MultiAttach
+Description: checks correct behaviou in case of multiple tries to attach to database
+Expected: Methods attaching/dettaching should be prepared for multiple calling
+*/
RUNNER_TEST(ORM_MultiAttach)
{
SmartAttach interface(false);
!interface.get()->IsAttached(), "Is attached, but shouldn't be.");
}
+/*
+Name: ORM_Join
+Description: tests ORM's join operation
+Expected: values should insist correct join operation
+*/
RUNNER_TEST(ORM_Join)
{
SmartAttach interface;
connection.ExecCommand("DROP TABLE test;");
}
+/*
+Name: SqlConnection_MassiveReadWrite_NaiveSynchronization
+Description: tests massive multiple quiries from many threads
+Expected: no ORM/db failures
+*/
RUNNER_TEST(SqlConnection_MassiveReadWrite_NaiveSynchronization)
{
srand(time(NULL));
MassiveReadWriteTest(&m_generator);
}
+/*
+Name: SqlConnection_Not_Connected_Lucene
+Description: tests connection to not existing database with Lucene option
+Expected: exception throw
+*/
RUNNER_TEST(SqlConnection_Not_Connected_Lucene)
{
Try {
}
}
+/*
+Name: SqlConnection_Not_Connected
+Description: tests connection to not existing database without Lucene option
+Expected: exception throw
+*/
RUNNER_TEST(SqlConnection_Not_Connected)
{
Try {
}
}
+/*
+Name: SqlConnection_Null_Query
+Description: tests resistance to passing NULL as query in ExecCommand
+Expected: exception throw
+*/
RUNNER_TEST(SqlConnection_Null_Query)
{
DPL::DB::SqlConnection connection(PATH_DB,
}
}
+/*
+Name: SqlConnection_Bad_Query
+Description: tests resistance to passing trash as query in ExecCommand
+Expected: exception throw
+*/
RUNNER_TEST(SqlConnection_Bad_Query)
{
DPL::DB::SqlConnection connection(PATH_DB,
RUNNER_TEST_GROUP_INIT(DPL)
+/*
+Name: AcquireSessionBus
+Description: tests acquiring session bus
+Expected: no exceptions
+*/
RUNNER_TEST(AcquireSessionBus)
{
try {
}
}
+/*
+Name: AcquireSystemBus
+Description: tests acquiring system bus
+Expected: no exceptions
+*/
RUNNER_TEST(AcquireSystemBus)
{
try {
}
}
+/*
+Name: ParseNodeInfo
+Description: creates dbus interface from xml string
+Expected: interface should be created correctly
+*/
RUNNER_TEST(ParseNodeInfo)
{
try {
}
}
+/*
+Name: InvokeRemoteMethod
+Description: performs procedure call via dbus
+Expected: call should return not empty id
+*/
RUNNER_TEST(InvokeRemoteMethod)
{
try {
}
};
+/*
+Name: RegisterService
+Description: tests event listener for AcquiredEvent in context of dbus
+Expected: event should be received
+*/
DBUS_TEST(RegisterService)
{
try {
}
};
+/*
+Name: Controller_InitSimple
+Description: tests initialization of simple int controller
+Expected: no exceptions
+*/
RUNNER_TEST(Controller_InitSimple)
{
IntController controller;
RUNNER_ASSERT(controller.Value() == -1);
}
+/*
+Name: Controller_InitStrange
+Description: tests initialization of struct controller
+Expected: no exceptions
+*/
RUNNER_TEST(Controller_InitStrange)
{
StrangeController controller;
controller.Touch();
}
+/*
+Name: Controller_PostEventToThread
+Description: tests post events to other thread
+Expected: thread id gathered in event handling method should match id of created thread
+*/
RUNNER_TEST(Controller_PostEventToThread)
{
ThreadController controller;
RUNNER_ASSERT(controller.Value() == &thread);
}
+/*
+Name: Controller_PostTimedEventToThread
+Description: tests post events to other thread with time delay
+Expected: thread id gathered in event handling method should match id of created thread
+*/
RUNNER_TEST(Controller_PostTimedEventToThread)
{
ThreadController controller;
}
};
+/*
+Name: Controller_TouchInThread
+Description: tests ability to touch (initizilize / set destination thread) in creatd thread
+ other than thread were controlelr object was created
+Expected: thread id gathered in event handling method should match id of created thread
+*/
RUNNER_TEST(Controller_TouchInThread)
{
TouchInThreadController controller;
RUNNER_ASSERT(touchedThread == &thread);
}
+/*
+Name: Controller_SynchronizedEvent
+Description: tests ability to post synchronized events to ther thread
+Expected: correct value should be saved when event was handled
+*/
RUNNER_TEST(Controller_SynchronizedEvent)
{
IntController controller;
}
};
+/*
+Name: Controllers_MultipleEvents
+Description: tests controller coooperation.
+ This runs many controllers in many threads. Each controller sends
+ to other randomly chosen controller events.
+Expected: Test is supposed to be ended when all limits of sent event will be reach
+ -> all scheduled event will be sent and received.
+*/
RUNNER_TEST(Controllers_MultipleEvents)
{
srand(time(NULL) );
}
};
+/*
+Name: EventSupport_DestroyBeforeProcessing
+Description: tests if remoign listener is full successfull
+Expected: dummy var should be affected by explicit call of ZeroDummyVar(),
+ but no by emitting event after removing listener
+*/
RUNNER_TEST(EventSupport_DestroyBeforeProcessing)
{
QuitController quitter;
}
};
+/*
+Name: EventSupport_BindDelegate
+Description: tests if event support derived class successfully propagates
+ event to registered listener
+Expected: value of event should be passed to listener
+*/
RUNNER_TEST(EventSupport_BindDelegate)
{
g_delegateTest = 0;
ICTestController* m_controller;
};
+/*
+Name: ICDelegate_0
+Description: checks if delegetes are correctly called
+Expected: delegates should be called from right context
+*/
RUNNER_TEST(ICDelegate_0)
{
DPL::Thread thread;
result.TestEventsPassed();
}
+/*
+Name: ICDelegate_1
+Description: checks if delegetes are correctly called
+Expected: delegates should be called from right context
+*/
RUNNER_TEST(ICDelegate_1)
{
DPL::Thread thread;
int m_tests;
};
+/*
+Name: ICDelegate_2
+Description: checks if delegetes are correctly called
+Expected: delegates should be called from right context
+*/
RUNNER_TEST(ICDelegate_2)
{
LogDebug("Creating test threads");
int m_reuseCount;
};
+/*
+Name: ICDelegate_3
+Description: checks if delegetes are correctly called
+Expected: delegates should be called from right context
+*/
RUNNER_TEST(ICDelegate_3)
{
DPL::Thread thread;
g_caption = event.value;
}
+/*
+Name: Model_Test
+Description: tests accessing and changing models properties
+Expected: listener should get changed value
+*/
RUNNER_TEST(Model_Test)
{
MyModel model;
RUNNER_TEST_GROUP_INIT(DPL_BASH_UTILS)
+/*
+Name: Bash_Utils_escape_arg
+Description:tests ecaping bash special characters for command arguments
+Expected: matching string
+*/
RUNNER_TEST(Bash_Utils_escape_arg)
{
RUNNER_ASSERT_MSG(escape_arg(std::string(
RUNNER_TEST_GROUP_INIT(DPL_WIDGET_VERSION)
+/*
+Name: WidgetVersion_M2_O0
+Description: tests correct parsing of version widget in format: [major].[minor]
+Expected: major and minor parts matches expected values
+*/
RUNNER_TEST(WidgetVersion_M2_O0)
{
DPL::String raw(L"1.2");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_M2_O0_nonwac_1
+Description: tests if version is recognized as wac version number
+Expected: version should not be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_M2_O0_nonwac_1)
{
DPL::String raw(L"a1.2");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_M2_O0_nonwac_2
+Description: tests if version is recognized as wac version number
+Expected: version should not be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_M2_O0_nonwac_2)
{
DPL::String raw(L"1.2a");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_M2_O0_nonwac_3
+Description: tests if version is recognized as wac version number
+Expected: version should not be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_M2_O0_nonwac_3)
{
DPL::String raw(L"aaa1.2bbb");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_M2_O0_nonwac_4
+Description: tests if version is recognized as wac version number
+Expected: version should not be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_M2_O0_nonwac_4)
{
DPL::String raw(L"1a.a2");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_M2_O0_long
+Description: tests correct parsing of version widget in format: [major].[minor]
+ for huge number
+Expected: major and minor parts matches expected values
+*/
RUNNER_TEST(WidgetVersion_M2_O0_long)
{
DPL::String raw(
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_M3_O0
+Description: tests correct wac version number
+Expected: major and minor and micro parts matches expected values.
+ Version should be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_M3_O0)
{
DPL::String raw(L"1.2.3");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_M3_O0_nonwac_1
+Description: tests if version is recognized as wac version number
+Expected: version should not be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_M3_O0_nonwac_1)
{
DPL::String raw(L"a1a.2.3");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_M3_O0_nonwac_2
+Description: tests if version is recognized as wac version number
+Expected: version should not be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_M3_O0_nonwac_2)
{
DPL::String raw(L"1.b2.3");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_M3_O0_nonwac_3
+Description: tests if version is recognized as wac version number
+Expected: version should not be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_M3_O0_nonwac_3)
{
DPL::String raw(L"1.2.3c");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_M3_O0_nonwac_4
+Description: tests if version is recognized as wac version number
+Expected: version should not be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_M3_O0_nonwac_4)
{
DPL::String raw(L"1.2.3a");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_M3_O1_1
+Description: tests correct wac version number with optional part
+Expected: major and minor and micro and optional parts matches expected values.
+ Version should be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_M3_O1_1)
{
DPL::String raw(L"1.2.3 test111");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_M3_O1_1
+Description: tests correct wac version number with numeric optional part
+Expected: major and minor and micro and optional parts matches expected values.
+ Version should be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_M3_O1_2)
{
DPL::String raw(L"1.2.3 111");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_M3_O1_3
+Description: tests if version is recognized as wac version number
+ when trailer spaces exists
+Expected: version should not be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_M3_O1_3)
{
DPL::String raw(L"1.2.3 ");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_M2_O1_1
+Description: tests if version is recognized as wac version number
+ when optional part
+Expected: version should be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_M2_O1_1)
{
DPL::String raw(L"1.2 t");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_Strange_0
+Description: tests if version is recognized as wac version number
+Expected: version should be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_Strange_0)
{
DPL::String raw(L"1");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_Strange_1
+Description: tests if version is recognized as wac version number
+Expected: version should not be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_Strange_1)
{
DPL::String raw(L".1");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_Strange_2
+Description: tests if version is recognized as wac version number
+Expected: version should not be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_Strange_2)
{
DPL::String raw(L"..1");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_Strange_3
+Description: tests if version is recognized as wac version number
+Expected: version should not be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_Strange_3)
{
DPL::String raw(L"...1");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_Strange_4
+Description: tests if version is recognized as wac version number
+Expected: version should not be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_Strange_4)
{
DPL::String raw(L"qwerty");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_Strange_5
+Description: tests if version is recognized as wac version number
+Expected: version should not be recognized as wac compatible
+*/
RUNNER_TEST(WidgetVersion_Strange_5)
{
DPL::String raw(L"!@#$%^&*()_+ ^&%^*&%$^*&%*()& JHKJLHKJLH 685685687");
RUNNER_ASSERT(version.Raw() == raw);
}
+/*
+Name: WidgetVersion_Compare_0
+Description: tests version comparision in format [major].[minor]
+Expected: compare should work as expected
+*/
RUNNER_TEST(WidgetVersion_Compare_0)
{
RUNNER_ASSERT(WidgetVersion(L"1.1") < WidgetVersion(L"1.2"));
}
+/*
+Name: WidgetVersion_Compare_1
+Description: tests version comparision in format [major].[minor]
+Expected: compare should work as expected
+*/
RUNNER_TEST(WidgetVersion_Compare_1)
{
RUNNER_ASSERT(WidgetVersion(L"01.001") < WidgetVersion(L"0001.002"));
}
+/*
+Name: WidgetVersion_Compare_2
+Description: tests version equality in format [major].[minor]
+Expected: versions should be equal
+*/
RUNNER_TEST(WidgetVersion_Compare_2)
{
RUNNER_ASSERT(WidgetVersion(L"0.1") == WidgetVersion(L"00.1"));
}
+/*
+Name: WidgetVersion_Compare_3
+Description: tests version comparision in format [major].[minor] [optional]
+Expected: compare should work as expected
+*/
RUNNER_TEST(WidgetVersion_Compare_3)
{
RUNNER_ASSERT(WidgetVersion(L"1.00000000000000") >=
WidgetVersion(L"1.0 test"));
}
+/*
+Name: WidgetVersion_Compare_4
+Description: tests version comparision for huge numbers
+Expected: compare should work as expected
+*/
RUNNER_TEST(WidgetVersion_Compare_4)
{
RUNNER_ASSERT(WidgetVersion(
> WidgetVersion(L"4324324324324324324321.000432"));
}
+/*
+Name: WidgetVersion_Compare_5
+Description: tests equality in format [major].[minor]
+Expected: versions should be equal
+*/
RUNNER_TEST(WidgetVersion_Compare_5)
{
RUNNER_ASSERT(WidgetVersion(L"12345.1") == WidgetVersion(L"12345.1"));
}
+/*
+Name: WidgetVersion_Compare_6
+Description: tests version equality in format [major].[minor]
+Expected: versions should not be equal
+*/
RUNNER_TEST(WidgetVersion_Compare_6)
{
RUNNER_ASSERT(WidgetVersion(L"1.1") != WidgetVersion(L"1.11"));
}
+/*
+Name: WidgetVersion_Compare_7
+Description: tests version equality in format [major].[minor] [optional]
+Expected: versions should be equal, optional part should not be taken into account
+*/
RUNNER_TEST(WidgetVersion_Compare_7)
{
RUNNER_ASSERT(WidgetVersion(L"000123000.0 notatest") ==
RUNNER_TEST_GROUP_INIT(DPL_WRT_UTILITY)
+/*
+Name: wrt_utility_WrtUtilJoinPaths
+Description: join paths test
+Expected: correctly used separator
+*/
RUNNER_TEST(wrt_utility_WrtUtilJoinPaths)
{
std::string result;
"Removing non existing directory returned success");
}
+/*
+Name: wrt_utility_WrtUtilFileExists
+Description: tests file existence
+Expected: existing file should be reported as existing
+*/
RUNNER_TEST(wrt_utility_WrtUtilFileExists)
{
std::ofstream file;
RUNNER_ASSERT(WrtUtilFileExists("/tmp/test_file1") == false);
}
+/*
+Name: wrt_utility_WrtUtilDirExists
+Description: tests directory existence
+Expected: existing directory should be reported as existing
+*/
RUNNER_TEST(wrt_utility_WrtUtilDirExists)
{
RUNNER_ASSERT(WrtUtilDirExists("/tmp"));