FOSSology  4.7.1
Open Source License Compliance by Open Source Software
ReuserDatabaseHandlerTest Class Reference
Inheritance diagram for ReuserDatabaseHandlerTest:
Inheritance graph
Collaboration diagram for ReuserDatabaseHandlerTest:
Collaboration graph

Protected Member Functions

void testGetClearingDecisionMapReturnsFirstDecisionPerPfile ()
 getClearingDecisionMapByPfile returns one entry per distinct pfile_fk. More...
 
void testGetClearingDecisionMapEmptyOnNoData ()
 getClearingDecisionMapByPfile returns an empty map when no callback is set. More...
 
void testGetUploadTreePksGroupedByPfile ()
 getUploadTreePksForPfiles groups uploadtree_pk values by pfile_fk. More...
 
void testGetUploadTreePksEmptyOnEmptyInput ()
 getUploadTreePksForPfiles returns an empty map for an empty pfile list. More...
 
void testGetReusedUploadsReturnedInOrder ()
 getReusedUploads preserves the order and content of ReuseTriple entries. More...
 
void testGetParentItemBoundsPopulatesStruct ()
 getParentItemBounds populates all ItemTreeBounds fields on success. More...
 

Private Member Functions

 CPPUNIT_TEST_SUITE (ReuserDatabaseHandlerTest)
 
 CPPUNIT_TEST (testGetClearingDecisionMapReturnsFirstDecisionPerPfile)
 
 CPPUNIT_TEST (testGetClearingDecisionMapEmptyOnNoData)
 
 CPPUNIT_TEST (testGetUploadTreePksGroupedByPfile)
 
 CPPUNIT_TEST (testGetUploadTreePksEmptyOnEmptyInput)
 
 CPPUNIT_TEST (testGetReusedUploadsReturnedInOrder)
 
 CPPUNIT_TEST (testGetParentItemBoundsPopulatesStruct)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 23 of file test_database_handler.cc.

Member Function Documentation

◆ testGetClearingDecisionMapEmptyOnNoData()

void ReuserDatabaseHandlerTest::testGetClearingDecisionMapEmptyOnNoData ( )
inlineprotected

getClearingDecisionMapByPfile returns an empty map when no callback is set.

The default mock behaviour (no onGetClearingDecisionMapByPfile callback) must return an empty map rather than crashing or returning garbage.

Definition at line 68 of file test_database_handler.cc.

◆ testGetClearingDecisionMapReturnsFirstDecisionPerPfile()

void ReuserDatabaseHandlerTest::testGetClearingDecisionMapReturnsFirstDecisionPerPfile ( )
inlineprotected

getClearingDecisionMapByPfile returns one entry per distinct pfile_fk.

The map key is the pfile_fk and the value is the clearing_decision_pk. When the callback returns two rows for different pfiles, both must appear in the result with their respective decision ids.

Definition at line 42 of file test_database_handler.cc.

◆ testGetParentItemBoundsPopulatesStruct()

void ReuserDatabaseHandlerTest::testGetParentItemBoundsPopulatesStruct ( )
inlineprotected

getParentItemBounds populates all ItemTreeBounds fields on success.

When the callback writes to the output parameter and returns true, every field of the struct (uploadtree_pk, uploadTreeTableName, upload_fk, lft, rgt) must reflect the values written by the callback.

Definition at line 157 of file test_database_handler.cc.

◆ testGetReusedUploadsReturnedInOrder()

void ReuserDatabaseHandlerTest::testGetReusedUploadsReturnedInOrder ( )
inlineprotected

getReusedUploads preserves the order and content of ReuseTriple entries.

The returned vector must contain every element delivered by the callback in the same order, with reusedUploadId and reuseMode intact.

Definition at line 130 of file test_database_handler.cc.

◆ testGetUploadTreePksEmptyOnEmptyInput()

void ReuserDatabaseHandlerTest::testGetUploadTreePksEmptyOnEmptyInput ( )
inlineprotected

getUploadTreePksForPfiles returns an empty map for an empty pfile list.

Passing an empty pfile id vector must yield an empty result map; no crash or undefined behaviour is acceptable.

Definition at line 116 of file test_database_handler.cc.

◆ testGetUploadTreePksGroupedByPfile()

void ReuserDatabaseHandlerTest::testGetUploadTreePksGroupedByPfile ( )
inlineprotected

getUploadTreePksForPfiles groups uploadtree_pk values by pfile_fk.

For each pfile_fk in the input list the result map must contain an entry whose value is the vector of matching uploadtree primary keys, preserving order within each group.

Definition at line 83 of file test_database_handler.cc.


The documentation for this class was generated from the following file: