FOSSology  4.7.1
Open Source License Compliance by Open Source Software
test_worker.cc File Reference

Unit tests for processUploadId (ReuserUtils.cc). More...

#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include "MockReuserDatabaseHandler.hpp"
#include "ReuserState.hpp"
#include "ReuserTypes.hpp"
Include dependency graph for test_worker.cc:

Go to the source code of this file.

Classes

class  ReuserWorkerTest
 

Functions

static bool runProcessUpload (ReuserDatabaseHandler &db, int uploadId, int groupId, int userId)
 Minimal replica of processUploadId for unit-testing. More...
 
 CPPUNIT_TEST_SUITE_REGISTRATION (ReuserWorkerTest)
 

Detailed Description

Unit tests for processUploadId (ReuserUtils.cc).

Exercises the reuse dispatch logic (which REUSE_* path is called, whether bail-out on error works) without touching the database.

Definition in file test_worker.cc.

Function Documentation

◆ runProcessUpload()

static bool runProcessUpload ( ReuserDatabaseHandler db,
int  uploadId,
int  groupId,
int  userId 
)
static

Minimal replica of processUploadId for unit-testing.

The real processUploadId calls fo_scheduler_groupID() / fo_scheduler_userID() which need a running scheduler. This helper accepts the ids directly so tests remain self-contained.

Definition at line 28 of file test_worker.cc.