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

Protected Member Functions

void testNoReuseLinkSucceedsWithoutProcessing ()
 No upload_reuse row exists for this upload. More...
 
void testReuseExistsButSourceHasNoClearings ()
 upload_reuse row exists but the source upload has no clearing decisions. More...
 
void testCorrectArgumentsForwardedToProcessUploadReuse ()
 All five arguments are forwarded correctly to processUploadReuse. More...
 
void testRepoClearingUsesStandardReusePath ()
 reuseMode == 0 always takes the standard reuse path. More...
 
void testEnhancedReuseUsesEnhancedPath ()
 REUSE_ENHANCED bit routes to processEnhancedUploadReuse. More...
 
void testEnhancedReuseFailurePropagates ()
 A false return from processEnhancedUploadReuse propagates to the caller.
 
void testMultipleReuseLinksAllProcessed ()
 All upload_reuse rows for an upload are processed in order. More...
 
void testReuseMainLicenseFlagOnly ()
 REUSE_MAIN bit causes only reuseMainLicense to be called. More...
 
void testReuseConfFlagOnly ()
 REUSE_CONF bit causes only reuseConfSettings to be called. More...
 
void testReuseCopyrightFlagOnly ()
 REUSE_COPYRIGHT bit causes only reuseCopyrights to be called. More...
 
void testOptionalFlagsNotCalledWithoutBits ()
 reuseMode == 0 -> only processUploadReuse is called, no optional extras. More...
 

Private Member Functions

 CPPUNIT_TEST_SUITE (ReuserScenarioTest)
 
 CPPUNIT_TEST (testNoReuseLinkSucceedsWithoutProcessing)
 
 CPPUNIT_TEST (testReuseExistsButSourceHasNoClearings)
 
 CPPUNIT_TEST (testCorrectArgumentsForwardedToProcessUploadReuse)
 
 CPPUNIT_TEST (testRepoClearingUsesStandardReusePath)
 
 CPPUNIT_TEST (testEnhancedReuseUsesEnhancedPath)
 
 CPPUNIT_TEST (testEnhancedReuseFailurePropagates)
 
 CPPUNIT_TEST (testMultipleReuseLinksAllProcessed)
 
 CPPUNIT_TEST (testReuseMainLicenseFlagOnly)
 
 CPPUNIT_TEST (testReuseConfFlagOnly)
 
 CPPUNIT_TEST (testReuseCopyrightFlagOnly)
 
 CPPUNIT_TEST (testOptionalFlagsNotCalledWithoutBits)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 76 of file test_scenarios.cc.

Member Function Documentation

◆ testCorrectArgumentsForwardedToProcessUploadReuse()

void ReuserScenarioTest::testCorrectArgumentsForwardedToProcessUploadReuse ( )
inlineprotected

All five arguments are forwarded correctly to processUploadReuse.

Verifies that uploadId, reusedUploadId, groupId, reusedGroupId and userId are passed through without modification.

Definition at line 166 of file test_scenarios.cc.

◆ testEnhancedReuseUsesEnhancedPath()

void ReuserScenarioTest::testEnhancedReuseUsesEnhancedPath ( )
inlineprotected

REUSE_ENHANCED bit routes to processEnhancedUploadReuse.

When the REUSE_ENHANCED bit is set in reuseMode, processEnhancedUploadReuse must be called and processUploadReuse must not be called.

Definition at line 257 of file test_scenarios.cc.

◆ testMultipleReuseLinksAllProcessed()

void ReuserScenarioTest::testMultipleReuseLinksAllProcessed ( )
inlineprotected

All upload_reuse rows for an upload are processed in order.

A single agent invocation iterates over every reuse link returned by getReusedUploads and calls processUploadReuse for each.

Definition at line 312 of file test_scenarios.cc.

◆ testNoReuseLinkSucceedsWithoutProcessing()

void ReuserScenarioTest::testNoReuseLinkSucceedsWithoutProcessing ( )
inlineprotected

No upload_reuse row exists for this upload.

getReusedUploads returns an empty list -> no processing takes place, the overall result is success.

Definition at line 113 of file test_scenarios.cc.

◆ testOptionalFlagsNotCalledWithoutBits()

void ReuserScenarioTest::testOptionalFlagsNotCalledWithoutBits ( )
inlineprotected

reuseMode == 0 -> only processUploadReuse is called, no optional extras.

With none of the REUSE_MAIN, REUSE_CONF, or REUSE_COPYRIGHT bits set, none of the corresponding methods must be called.

Definition at line 461 of file test_scenarios.cc.

◆ testRepoClearingUsesStandardReusePath()

void ReuserScenarioTest::testRepoClearingUsesStandardReusePath ( )
inlineprotected

reuseMode == 0 always takes the standard reuse path.

The clearing scope (ITEM vs REPO) is a database attribute that the agent never inspects. Without the REUSE_ENHANCED bit, processUploadReuse is called regardless of which scope the source clearing has.

Definition at line 221 of file test_scenarios.cc.

◆ testReuseConfFlagOnly()

void ReuserScenarioTest::testReuseConfFlagOnly ( )
inlineprotected

REUSE_CONF bit causes only reuseConfSettings to be called.

reuseMainLicense and reuseCopyrights must remain uncalled.

Definition at line 381 of file test_scenarios.cc.

◆ testReuseCopyrightFlagOnly()

void ReuserScenarioTest::testReuseCopyrightFlagOnly ( )
inlineprotected

REUSE_COPYRIGHT bit causes only reuseCopyrights to be called.

reuseMainLicense and reuseConfSettings must remain uncalled.

Definition at line 421 of file test_scenarios.cc.

◆ testReuseExistsButSourceHasNoClearings()

void ReuserScenarioTest::testReuseExistsButSourceHasNoClearings ( )
inlineprotected

upload_reuse row exists but the source upload has no clearing decisions.

The agent calls processUploadReuse and trusts the return value. Whether 0 rows were actually copied is a database detail the agent must succeed as long as processUploadReuse returns true.

Definition at line 137 of file test_scenarios.cc.

◆ testReuseMainLicenseFlagOnly()

void ReuserScenarioTest::testReuseMainLicenseFlagOnly ( )
inlineprotected

REUSE_MAIN bit causes only reuseMainLicense to be called.

reuseConfSettings and reuseCopyrights must remain uncalled.

Definition at line 341 of file test_scenarios.cc.


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