mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
ThirdParty: Update included gtest
This commit is contained in:
@@ -33,8 +33,8 @@
|
||||
// prime and determines a next prime number. This interface is used
|
||||
// in Google Test samples demonstrating use of parameterized tests.
|
||||
|
||||
#ifndef GTEST_SAMPLES_PRIME_TABLES_H_
|
||||
#define GTEST_SAMPLES_PRIME_TABLES_H_
|
||||
#ifndef GOOGLETEST_SAMPLES_PRIME_TABLES_H_
|
||||
#define GOOGLETEST_SAMPLES_PRIME_TABLES_H_
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -43,7 +43,7 @@ class PrimeTable {
|
||||
public:
|
||||
virtual ~PrimeTable() {}
|
||||
|
||||
// Returns true iff n is a prime number.
|
||||
// Returns true if and only if n is a prime number.
|
||||
virtual bool IsPrime(int n) const = 0;
|
||||
|
||||
// Returns the smallest prime number greater than p; or returns -1
|
||||
@@ -66,11 +66,11 @@ class OnTheFlyPrimeTable : public PrimeTable {
|
||||
}
|
||||
|
||||
int GetNextPrime(int p) const override {
|
||||
for (int n = p + 1; n > 0; n++) {
|
||||
if (p < 0) return -1;
|
||||
|
||||
for (int n = p + 1;; n++) {
|
||||
if (IsPrime(n)) return n;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -123,4 +123,4 @@ class PreCalculatedPrimeTable : public PrimeTable {
|
||||
void operator=(const PreCalculatedPrimeTable& rhs);
|
||||
};
|
||||
|
||||
#endif // GTEST_SAMPLES_PRIME_TABLES_H_
|
||||
#endif // GOOGLETEST_SAMPLES_PRIME_TABLES_H_
|
||||
|
||||
Reference in New Issue
Block a user