Commit 5e467db9 authored by Mathieu Valois's avatar Mathieu Valois
Browse files

[Test] Add test to check correctness of parallel computation

parent 2fe115c2
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -6,7 +6,8 @@ build-cli:
    - apt-get -qq -y install build-essential cmake
  script:
    - cmake .
    - make -j$(nproc) cppack
    - make -j$(nproc) cppack cppack-test
    - make test
  artifacts:
    paths:
      - bin/cppack
+8 −1
Original line number Diff line number Diff line
@@ -51,3 +51,10 @@ if(Qt5Core_FOUND)
else()
	message(STATUS "Qt5 not found. Not building GUI.")
endif()

add_executable(cppack-test
				src/core/Statsgen.cpp
				src/core/Policy.cpp
				src/core/ThreadData.cpp
				src/test/cppack-tests.cpp)
target_link_libraries(cppack-test ${CMAKE_THREAD_LIBS_INIT})
 No newline at end of file
+0 −1
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ class ProgressThread : public QThread

        while(!_s.allFinished()){
            processed = 0;
            finished = 0;
            for(int i=0; i < nbthreads; ++i){
                processed += td[i].total_counter;
            }
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ struct SecurityRules {
	uint minDigit;
	uint minLower;
	uint minUpper;
	bool operator==(const SecurityRules& o) const;
};


+1 −0
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ public:
	inline const ThreadData* getThreadsData() const { return td; }
	inline bool allFinished() const { return finished == nbThread; }
	inline bool allStarted() const { return started; }
	bool operator==(const Statsgen& other) const;

private:
	std::string filename;
Loading