Fixed unity compilation issues

This commit is contained in:
Alexander Borsuk 2021-12-30 22:40:20 +01:00
parent 40116e5dd5
commit f346465801
11 changed files with 20 additions and 33 deletions

View file

@ -6,7 +6,7 @@
#include <string>
#include <type_traits>
namespace
namespace newtype_test
{
NEWTYPE(int, Int);
@ -112,4 +112,4 @@ UNIT_TEST(NewType_SimpleOutPut)
sstr << Int(20);
TEST_EQUAL(sstr.str(), "20", ());
}
} // namespace
} // namespace newtype_test

View file

@ -10,7 +10,7 @@
using namespace base;
namespace
namespace stl_helpers_test
{
class Int
{
@ -153,7 +153,7 @@ UNIT_TEST(IgnoreFirstArgument)
}
}
namespace
namespace
{
struct EqualZero
{
@ -326,4 +326,4 @@ UNIT_TEST(AccumulateIntervals)
CheckAccumulateIntervals(idTest, arr1, arr2, res);
}
}
} // namespace
} // namespace stl_helpers_test

View file

@ -13,7 +13,7 @@ using namespace base::thread_pool::delayed;
UNIT_TEST(ThreadSafeQueue_ThreadSafeQueue)
{
base::threads::ThreadSafeQueue<size_t> queue;
threads::ThreadSafeQueue<size_t> queue;
TEST(queue.Empty(), ());
TEST_EQUAL(queue.Size(), 0, ());
@ -22,7 +22,7 @@ UNIT_TEST(ThreadSafeQueue_ThreadSafeQueue)
UNIT_TEST(ThreadSafeQueue_Push)
{
size_t const kSize = 100;
base::threads::ThreadSafeQueue<size_t> queue;
threads::ThreadSafeQueue<size_t> queue;
ThreadPool pool(2, ThreadPool::Exit::ExecPending);
for (size_t i = 0; i < kSize; ++i)
{
@ -39,7 +39,7 @@ UNIT_TEST(ThreadSafeQueue_Push)
UNIT_TEST(ThreadSafeQueue_WaitAndPop)
{
using namespace std::chrono_literals;
base::threads::ThreadSafeQueue<size_t> queue;
threads::ThreadSafeQueue<size_t> queue;
size_t const value = 101;
size_t result;
auto thread = std::thread([&]() {
@ -57,7 +57,7 @@ UNIT_TEST(ThreadSafeQueue_WaitAndPop)
UNIT_TEST(ThreadSafeQueue_TryPop)
{
using namespace std::chrono_literals;
base::threads::ThreadSafeQueue<size_t> queue;
threads::ThreadSafeQueue<size_t> queue;
size_t const value = 101;
size_t result;
auto thread = std::thread([&]() {
@ -75,7 +75,7 @@ UNIT_TEST(ThreadSafeQueue_TryPop)
UNIT_TEST(ThreadSafeQueue_ExampleWithDataWrapper)
{
size_t const kSize = 100000;
base::threads::ThreadSafeQueue<std::optional<size_t>> queue;
threads::ThreadSafeQueue<std::optional<size_t>> queue;
auto thread = std::thread([&]() {
while (true)

View file

@ -5,8 +5,6 @@
#include <queue>
#include <utility>
namespace base
{
namespace threads
{
template <typename T>
@ -76,4 +74,3 @@ private:
std::condition_variable m_cond;
};
} // namespace threads
} // namespace base

View file

@ -5,8 +5,6 @@
#include "base/macros.hpp"
namespace base
{
namespace threads
{
template <typename Thread = std::thread, typename ThreadContainer = std::vector<Thread>>
@ -77,4 +75,3 @@ private:
DISALLOW_COPY(FunctionWrapper);
};
} // namespace threads
} // namespace base

View file

@ -25,5 +25,5 @@ struct ProcessedData
};
using FeatureProcessorChunk = std::optional<std::vector<ProcessedData>>;
using FeatureProcessorQueue = base::threads::ThreadSafeQueue<FeatureProcessorChunk>;
using FeatureProcessorQueue = threads::ThreadSafeQueue<FeatureProcessorChunk>;
} // namespace generator

View file

@ -31,7 +31,7 @@ bool TranslatorsPool::Finish()
{
m_threadPool.WaitingStop();
using TranslatorPtr = std::shared_ptr<TranslatorInterface>;
base::threads::ThreadSafeQueue<std::future<TranslatorPtr>> queue;
threads::ThreadSafeQueue<std::future<TranslatorPtr>> queue;
while (!m_translators.Empty())
{
std::promise<TranslatorPtr> p;

View file

@ -23,6 +23,6 @@ public:
private:
base::thread_pool::computational::ThreadPool m_threadPool;
base::threads::ThreadSafeQueue<std::shared_ptr<TranslatorInterface>> m_translators;
threads::ThreadSafeQueue<std::shared_ptr<TranslatorInterface>> m_translators;
};
} // namespace generator

View file

@ -25,9 +25,10 @@
#ifndef FIRSTSESSION_H
#define FIRSTSESSION_H
#import <CoreLocation/CoreLocation.h>
#import <Foundation/Foundation.h>
#import <Foundation/NSDate.h>
#import <CoreLocation/CoreLocation.h>
#import <TargetConditionals.h> // TARGET_OS_IPHONE
#if (TARGET_OS_IPHONE > 0)
#import <UIKit/UIApplication.h> // enum UIBackgroundFetchResult

View file

@ -30,7 +30,6 @@
#include <utility> // std::pair
#include <sys/xattr.h>
#include <TargetConditionals.h> // TARGET_OS_IPHONE
#import <CoreFoundation/CoreFoundation.h>
#import <CoreFoundation/CFURL.h>

View file

@ -22,7 +22,7 @@
# include "drape/drape_tests/gl_mock_functions.hpp"
#endif
#ifdef TARGET_OS_IPHONE
#ifdef OMIM_OS_IPHONE
# include <CoreFoundation/CoreFoundation.h>
#endif
@ -41,15 +41,9 @@
#endif
#endif
using namespace std;
namespace
{
base::Waiter g_waiter;
} // namespace
namespace testing
{
base::Waiter g_waiter;
void RunEventLoop()
{
@ -79,10 +73,7 @@ void Notify()
{
g_waiter.Notify();
}
} // namespace testing
namespace
{
bool g_lastTestOK = true;
CommandLineOptions g_testingOptions;
@ -146,7 +137,6 @@ void ParseOptions(int argc, char * argv[], CommandLineOptions & options)
options.m_listTests = true;
}
}
} // namespace
CommandLineOptions const & GetTestingOptions()
{
@ -307,3 +297,6 @@ int main(int argc, char * argv[])
LOG(LINFO, ("All tests passed."));
return STATUS_SUCCESS;
}
} // namespace testing
int main(int argc, char * argv[]) { return testing::main(argc, argv); }