diff options
Diffstat (limited to 'cpp/test')
21 files changed, 190 insertions, 190 deletions
diff --git a/cpp/test/Freeze/dbmap/Client.cpp b/cpp/test/Freeze/dbmap/Client.cpp index 1c4525123c5..edac3b40b14 100644 --- a/cpp/test/Freeze/dbmap/Client.cpp +++ b/cpp/test/Freeze/dbmap/Client.cpp @@ -72,7 +72,7 @@ populateDB(const Freeze::ConnectionPtr& connection, ByteIntMap& m) TransactionHolder txHolder(connection); for(size_t j = 0; j < length; ++j) { - m.put(ByteIntMap::value_type(localAlphabet[j], static_cast<Int>(j))); + m.put(ByteIntMap::value_type(localAlphabet[j], static_cast<Int>(j))); } txHolder.commit(); break; @@ -98,14 +98,14 @@ public: ReadThread(const CommunicatorPtr& communicator, const string& envName, const string& dbName) : _connection(createConnection(communicator, envName)), _map(_connection, dbName), - _done(false) + _done(false) { } virtual void run() { - bool more = false; + bool more = false; do { @@ -138,18 +138,18 @@ public: } } - { - IceUtil::Mutex::Lock lock(_doneMutex); - more = !_done; - } + { + IceUtil::Mutex::Lock lock(_doneMutex); + more = !_done; + } - } while(more); + } while(more); } void stop() { - IceUtil::Mutex::Lock lock(_doneMutex); - _done = true; + IceUtil::Mutex::Lock lock(_doneMutex); + _done = true; } private: @@ -170,14 +170,14 @@ public: WriteThread(const CommunicatorPtr& communicator, const string& envName, const string& dbName) : _connection(createConnection(communicator, envName)), _map(_connection, dbName), - _done(false) + _done(false) { } virtual void run() { - bool more = false; + bool more = false; // // Delete an recreate each object @@ -195,7 +195,7 @@ public: _map.erase(p); } txHolder.commit(); - break; // for (;;) + break; // for (;;) } catch(const DeadlockException&) { @@ -216,81 +216,81 @@ public: } populateDB(_connection, _map); - - // - // Now update without a transaction - // - - for(char c = 'a'; c != 'd'; ++c) - { - for(;;) - { - bool thrownBySet = false; - try - { - ByteIntMap::iterator p = _map.find(c); - try - { - if(p != _map.end()) - { - if(p->first == p->second + 'a') - { - p.set(p->first - 'A'); - } - else - { - p.set(p->first - 'a'); - } - } - } - catch(const DeadlockException&) - { - thrownBySet = true; - throw; - } - break; // for (;;) - } - catch(const DeadlockException&) - { - if(!thrownBySet) - { - cerr << "DeadlockException thrown by destructor!" << endl; - test(false); - } - + + // + // Now update without a transaction + // + + for(char c = 'a'; c != 'd'; ++c) + { + for(;;) + { + bool thrownBySet = false; + try + { + ByteIntMap::iterator p = _map.find(c); + try + { + if(p != _map.end()) + { + if(p->first == p->second + 'a') + { + p.set(p->first - 'A'); + } + else + { + p.set(p->first - 'a'); + } + } + } + catch(const DeadlockException&) + { + thrownBySet = true; + throw; + } + break; // for (;;) + } + catch(const DeadlockException&) + { + if(!thrownBySet) + { + cerr << "DeadlockException thrown by destructor!" << endl; + test(false); + } + #ifdef SHOW_EXCEPTIONS - if(thrownBySet) - { - cerr << "S" << flush; - } - else - { - cerr << "D" << flush; - } + if(thrownBySet) + { + cerr << "S" << flush; + } + else + { + cerr << "D" << flush; + } #endif - // Try again - } - catch(const InvalidPositionException&) - { + // Try again + } + catch(const InvalidPositionException&) + { #ifdef SHOW_EXCEPTIONS - cerr << "I" << flush; + cerr << "I" << flush; #endif - break; - } - } - } - - { - IceUtil::Mutex::Lock lock(_doneMutex); - more = !_done; - } + break; + } + } + } + + { + IceUtil::Mutex::Lock lock(_doneMutex); + more = !_done; + } } while(more); } void stop() { - IceUtil::Mutex::Lock lock(_doneMutex); - _done = true; + IceUtil::Mutex::Lock lock(_doneMutex); + _done = true; } private: @@ -729,23 +729,23 @@ run(const CommunicatorPtr& communicator, const string& envName) { ReadThreadPtr rt = new ReadThread(communicator, envName, dbName); controls.push_back(rt->start()); - readThreads.push_back(rt); + readThreads.push_back(rt); WriteThreadPtr wt = new WriteThread(communicator, envName, dbName); controls.push_back(wt->start()); - writeThreads.push_back(wt); + writeThreads.push_back(wt); } IceUtil::ThreadControl::sleep(IceUtil::Time::seconds(CONCURRENT_TIME)); for(vector<WriteThreadPtr>::iterator q = writeThreads.begin(); q != writeThreads.end(); ++q) { - (*q)->stop(); + (*q)->stop(); } for(vector<ReadThreadPtr>::iterator q = readThreads.begin(); q != readThreads.end(); ++q) { - (*q)->stop(); + (*q)->stop(); } for(vector<IceUtil::ThreadControl>::iterator q = controls.begin(); q != controls.end(); ++q) diff --git a/cpp/test/Freeze/evictor/Client.cpp b/cpp/test/Freeze/evictor/Client.cpp index 1dc38845e76..be7f8493939 100644 --- a/cpp/test/Freeze/evictor/Client.cpp +++ b/cpp/test/Freeze/evictor/Client.cpp @@ -372,12 +372,12 @@ public: // // Transfer 100 at random between two distinct accounts // - Test::AccountPrx from = _accounts[IceUtilInternal::random(static_cast<int>(_accounts.size()))]; + Test::AccountPrx from = _accounts[IceUtilInternal::random(static_cast<int>(_accounts.size()))]; Test::AccountPrx to; do { - to = _accounts[IceUtilInternal::random(static_cast<int>(_accounts.size()))]; + to = _accounts[IceUtilInternal::random(static_cast<int>(_accounts.size()))]; } while(from == to); @@ -613,8 +613,8 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator, bool trans // try { - Test::AccountPrx::uncheckedCast(servants[0])->getBalance(); - test(false); + Test::AccountPrx::uncheckedCast(servants[0])->getBalance(); + test(false); } catch(const Ice::OperationNotExistException&) { diff --git a/cpp/test/Glacier2/override/Client.cpp b/cpp/test/Glacier2/override/Client.cpp index d35f638d37f..9945f1f05c0 100644 --- a/cpp/test/Glacier2/override/Client.cpp +++ b/cpp/test/Glacier2/override/Client.cpp @@ -155,21 +155,21 @@ CallbackClient::run(int argc, char* argv[]) callbackReceiverImpl->activate(); test(callbackReceiverImpl->callbackWithPayloadOK(4) == 0); - int remainingCallbacks = callbackReceiverImpl->callbackOK(1, 0); - // - // Occasionally, Glacier2 flushes in the middle of our 5 - // callbacks, so we get more than 1 callback - // (in theory we could get up to 5 total - more than 1 extra is extremely unlikely) - // - // The sleep above is also important as we want to have enough - // time to receive this (these) extra callback(s). - // - test(remainingCallbacks <= 4); - if(remainingCallbacks > 0) - { - test(callbackReceiverImpl->callbackOK(remainingCallbacks, 0) == 0); - } - + int remainingCallbacks = callbackReceiverImpl->callbackOK(1, 0); + // + // Occasionally, Glacier2 flushes in the middle of our 5 + // callbacks, so we get more than 1 callback + // (in theory we could get up to 5 total - more than 1 extra is extremely unlikely) + // + // The sleep above is also important as we want to have enough + // time to receive this (these) extra callback(s). + // + test(remainingCallbacks <= 4); + if(remainingCallbacks > 0) + { + test(callbackReceiverImpl->callbackOK(remainingCallbacks, 0) == 0); + } + ctx["_fwd"] = "O"; oneway->initiateCallbackWithPayload(twowayR); diff --git a/cpp/test/Ice/custom/AllTests.cpp b/cpp/test/Ice/custom/AllTests.cpp index f9d746cfb95..f9d746cfb95 100755..100644 --- a/cpp/test/Ice/custom/AllTests.cpp +++ b/cpp/test/Ice/custom/AllTests.cpp diff --git a/cpp/test/Ice/invoke/BlobjectI.cpp b/cpp/test/Ice/invoke/BlobjectI.cpp index 7d7d3612a43..7d7d3612a43 100755..100644 --- a/cpp/test/Ice/invoke/BlobjectI.cpp +++ b/cpp/test/Ice/invoke/BlobjectI.cpp diff --git a/cpp/test/Ice/metrics/AllTests.cpp b/cpp/test/Ice/metrics/AllTests.cpp index 4f83d4b0fbe..85f5062c958 100644 --- a/cpp/test/Ice/metrics/AllTests.cpp +++ b/cpp/test/Ice/metrics/AllTests.cpp @@ -400,7 +400,7 @@ allTests(const Ice::CommunicatorPtr& communicator) IceMX::MetricsView view = clientMetrics->getMetricsView("View", timestamp); test(view["Connection"].size() == 1 && view["Connection"][0]->current == 1 && view["Connection"][0]->total == 1); test(view["Thread"].size() == 1 && view["Thread"][0]->current == threadCount && - view["Thread"][0]->total == threadCount); + view["Thread"][0]->total == threadCount); cout << "ok" << endl; cout << "testing group by id..." << flush; diff --git a/cpp/test/Ice/objects/AllTests.cpp b/cpp/test/Ice/objects/AllTests.cpp index d1eb70a22de..0acf1cc340d 100644 --- a/cpp/test/Ice/objects/AllTests.cpp +++ b/cpp/test/Ice/objects/AllTests.cpp @@ -98,8 +98,8 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) AbstractBasePtr abp1 = new AbstractBaseI; try { - abp1->ice_clone(); - test(false); + abp1->ice_clone(); + test(false); } catch(const Ice::CloneNotImplementedException&) { diff --git a/cpp/test/Ice/operations/TestAMDI.cpp b/cpp/test/Ice/operations/TestAMDI.cpp index a51f098457a..a51f098457a 100755..100644 --- a/cpp/test/Ice/operations/TestAMDI.cpp +++ b/cpp/test/Ice/operations/TestAMDI.cpp diff --git a/cpp/test/Ice/operations/TestI.cpp b/cpp/test/Ice/operations/TestI.cpp index dd8b755edf3..dd8b755edf3 100755..100644 --- a/cpp/test/Ice/operations/TestI.cpp +++ b/cpp/test/Ice/operations/TestI.cpp diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp index a451acb0887..d59e18810d8 100644 --- a/cpp/test/Ice/operations/Twoways.cpp +++ b/cpp/test/Ice/operations/Twoways.cpp @@ -797,7 +797,7 @@ twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) } } #endif - } + } { Ice::Double d = 1278312346.0 / 13.0; diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp index 5fd79282d58..5e1c54e6df5 100644 --- a/cpp/test/Ice/operations/TwowaysAMI.cpp +++ b/cpp/test/Ice/operations/TwowaysAMI.cpp @@ -977,10 +977,10 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) } { - // + // // Check that a call to a twoway operation raises NoEndpointException // in the ice_exception() callback instead of at the point of call. - // + // Test::MyClassPrx indirect = Test::MyClassPrx::uncheckedCast(p->ice_adapterId("dummy")); AMI_MyClass_opByteExIPtr cb = new AMI_MyClass_opByteExI; try @@ -1004,9 +1004,9 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) } { - // + // // Check that CommunicatorDestroyedException is raised directly. - // + // Ice::InitializationData initData; initData.properties = communicator->getProperties()->clone(); Ice::CommunicatorPtr ic = Ice::initialize(initData); diff --git a/cpp/test/Ice/properties/Client.cpp b/cpp/test/Ice/properties/Client.cpp index b7b1ff02799..b7b1ff02799 100755..100644 --- a/cpp/test/Ice/properties/Client.cpp +++ b/cpp/test/Ice/properties/Client.cpp diff --git a/cpp/test/Ice/stream/Client.cpp b/cpp/test/Ice/stream/Client.cpp index 949f2770746..71b7c0b2685 100755..100644 --- a/cpp/test/Ice/stream/Client.cpp +++ b/cpp/test/Ice/stream/Client.cpp @@ -150,7 +150,7 @@ run(int argc, char** argv, const Ice::CommunicatorPtr& communicator) MyClassFactoryWrapperPtr factoryWrapper = new MyClassFactoryWrapper; communicator->addObjectFactory(factoryWrapper, Test::MyClass::ice_staticId()); communicator->addObjectFactory(new MyInterfaceFactory, Test::MyInterface::ice_staticId()); - + Ice::InputStreamPtr in; Ice::OutputStreamPtr out; vector<Ice::Byte> data; diff --git a/cpp/test/Ice/stringConverter/Client.cpp b/cpp/test/Ice/stringConverter/Client.cpp index a6b8ed7a811..048e2bf8f86 100644 --- a/cpp/test/Ice/stringConverter/Client.cpp +++ b/cpp/test/Ice/stringConverter/Client.cpp @@ -86,11 +86,11 @@ main(int argc, char* argv[]) #elif defined(__hpux) if(useLocale) { - initData.stringConverter = new Ice::IconvStringConverter<char>; + initData.stringConverter = new Ice::IconvStringConverter<char>; } else { - initData.stringConverter = new Ice::IconvStringConverter<char>("iso815"); + initData.stringConverter = new Ice::IconvStringConverter<char>("iso815"); } initData.wstringConverter = new Ice::IconvStringConverter<wchar_t>("ucs4"); #else @@ -98,12 +98,12 @@ main(int argc, char* argv[]) if(useLocale) { #ifndef _WIN32 - initData.stringConverter = new Ice::IconvStringConverter<char>; + initData.stringConverter = new Ice::IconvStringConverter<char>; #endif } else { - initData.stringConverter = new Ice::IconvStringConverter<char>("ISO8859-15"); + initData.stringConverter = new Ice::IconvStringConverter<char>("ISO8859-15"); } if(sizeof(wchar_t) == 4) diff --git a/cpp/test/IceStorm/rep1/Publisher.cpp b/cpp/test/IceStorm/rep1/Publisher.cpp index 62770b8632a..7671da08ec7 100644 --- a/cpp/test/IceStorm/rep1/Publisher.cpp +++ b/cpp/test/IceStorm/rep1/Publisher.cpp @@ -82,15 +82,15 @@ run(int argc, char* argv[], const CommunicatorPtr& communicator) Ice::ObjectPrx prx = topic->getPublisher()->ice_twoway(); vector<SinglePrx> single; Ice::EndpointSeq endpoints = prx->ice_getEndpoints(); - for(Ice::EndpointSeq::const_iterator p = endpoints.begin(); p != endpoints.end(); ++p) - { + for(Ice::EndpointSeq::const_iterator p = endpoints.begin(); p != endpoints.end(); ++p) + { if((*p)->toString().substr(0, 3) != "udp") { Ice::EndpointSeq e; e.push_back(*p); single.push_back(SinglePrx::uncheckedCast(prx->ice_endpoints(e))); } - } + } if(single.size() <= 1) { cerr << argv[0] << ": Not enough endpoints in publisher proxy" << endl; diff --git a/cpp/test/IceStorm/repstress/Publisher.cpp b/cpp/test/IceStorm/repstress/Publisher.cpp index 9f3eff6d7ca..76948483085 100644 --- a/cpp/test/IceStorm/repstress/Publisher.cpp +++ b/cpp/test/IceStorm/repstress/Publisher.cpp @@ -54,7 +54,7 @@ public: try { _single->event(_published); - IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(1)); + IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(1)); } catch(const Ice::UnknownException&) { diff --git a/cpp/test/IceUtil/condvar/WorkQueue.cpp b/cpp/test/IceUtil/condvar/WorkQueue.cpp index 7d093b7279e..e3f91c6a396 100644 --- a/cpp/test/IceUtil/condvar/WorkQueue.cpp +++ b/cpp/test/IceUtil/condvar/WorkQueue.cpp @@ -28,21 +28,21 @@ public: void decrement() { Monitor<Mutex>::Lock lock(*this); - assert(_count > 0); - --_count; - if(_count == 0) - { - notifyAll(); - } + assert(_count > 0); + --_count; + if(_count == 0) + { + notifyAll(); + } } void waitZero() { Monitor<Mutex>::Lock lock(*this); - while(_count > 0) - { - wait(); - } + while(_count > 0) + { + wait(); + } } private: @@ -80,7 +80,7 @@ public: { Monitor<Mutex>::Lock lock(*this); _terminate = true; - notifyAll(); + notifyAll(); } bool @@ -105,10 +105,10 @@ public: assert(!_q.empty()); ret = _q.front(); - if(ret % 100 == 0) - { - cout << "." << flush; - } + if(ret % 100 == 0) + { + cout << "." << flush; + } _q.pop_front(); return true; } @@ -126,16 +126,16 @@ public: // empty. if(_q.empty()) { - assert(_terminate); + assert(_terminate); return -1; } assert(!_q.empty()); int ret = _q.front(); - if(ret % 100 == 0) - { - cout << "." << flush; - } + if(ret % 100 == 0) + { + cout << "." << flush; + } _q.pop_front(); return ret; } @@ -158,18 +158,18 @@ public: virtual void run() { - _cd->decrement(); + _cd->decrement(); while(true) { int res = 0; - if(_poll) - { - _q->timedGet(res, Time::milliSeconds(10)); - } - else - { - res = _q->get(); - } + if(_poll) + { + _q->timedGet(res, Time::milliSeconds(10)); + } + else + { + res = _q->get(); + } if(res == -1) { return; @@ -196,14 +196,14 @@ public: virtual void run() { - _cd->decrement(); + _cd->decrement(); // Forever if(_v == 0) { while(true) { _q->put(_v++); - ThreadControl::yield(); + ThreadControl::yield(); } } else diff --git a/cpp/test/WinRT/TestSuite/App.xaml.cpp b/cpp/test/WinRT/TestSuite/App.xaml.cpp index 45902d60d63..9272b941977 100644 --- a/cpp/test/WinRT/TestSuite/App.xaml.cpp +++ b/cpp/test/WinRT/TestSuite/App.xaml.cpp @@ -30,8 +30,8 @@ using namespace Windows::UI::Xaml::Navigation; /// </summary>
App::App()
{
- InitializeComponent();
- Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
+ InitializeComponent();
+ Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
}
/// <summary>
@@ -42,29 +42,29 @@ App::App() /// <param name="pArgs">Details about the launch request and process.</param>
void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ pArgs)
{
- // Do not repeat app initialization when already running, just ensure that
- // the window is active
- if (pArgs->PreviousExecutionState == ApplicationExecutionState::Running)
- {
- Window::Current->Activate();
- return;
- }
+ // Do not repeat app initialization when already running, just ensure that
+ // the window is active
+ if (pArgs->PreviousExecutionState == ApplicationExecutionState::Running)
+ {
+ Window::Current->Activate();
+ return;
+ }
- if (pArgs->PreviousExecutionState == ApplicationExecutionState::Terminated)
- {
- //TODO: Load state from previously suspended application
- }
+ if (pArgs->PreviousExecutionState == ApplicationExecutionState::Terminated)
+ {
+ //TODO: Load state from previously suspended application
+ }
- // Create a Frame to act navigation context and navigate to the first page
- auto rootFrame = ref new Frame();
- if (!rootFrame->Navigate(TypeName(MainPage::typeid)))
- {
- throw ref new FailureException("Failed to create initial page");
- }
+ // Create a Frame to act navigation context and navigate to the first page
+ auto rootFrame = ref new Frame();
+ if (!rootFrame->Navigate(TypeName(MainPage::typeid)))
+ {
+ throw ref new FailureException("Failed to create initial page");
+ }
- // Place the frame in the current Window and ensure that it is active
- Window::Current->Content = rootFrame;
- Window::Current->Activate();
+ // Place the frame in the current Window and ensure that it is active
+ Window::Current->Content = rootFrame;
+ Window::Current->Activate();
}
/// <summary>
@@ -76,8 +76,8 @@ void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEvent /// <param name="e">Details about the suspend request.</param>
void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e)
{
- (void) sender; // Unused parameter
- (void) e; // Unused parameter
+ (void) sender; // Unused parameter
+ (void) e; // Unused parameter
- //TODO: Save application state and stop any background activity
+ //TODO: Save application state and stop any background activity
}
diff --git a/cpp/test/WinRT/TestSuite/App.xaml.h b/cpp/test/WinRT/TestSuite/App.xaml.h index d7cd0e08434..4fd9ca3458b 100644 --- a/cpp/test/WinRT/TestSuite/App.xaml.h +++ b/cpp/test/WinRT/TestSuite/App.xaml.h @@ -9,16 +9,16 @@ namespace TestSuite
{
- /// <summary>
- /// Provides application-specific behavior to supplement the default Application class.
- /// </summary>
- ref class App sealed
- {
- public:
- App();
- virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ pArgs) override;
+ /// <summary>
+ /// Provides application-specific behavior to supplement the default Application class.
+ /// </summary>
+ ref class App sealed
+ {
+ public:
+ App();
+ virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ pArgs) override;
- private:
- void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
- };
+ private:
+ void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
+ };
}
diff --git a/cpp/test/WinRT/TestSuite/MainPage.xaml.cpp b/cpp/test/WinRT/TestSuite/MainPage.xaml.cpp index 6dc1c29aef2..c9f02fa6d24 100644 --- a/cpp/test/WinRT/TestSuite/MainPage.xaml.cpp +++ b/cpp/test/WinRT/TestSuite/MainPage.xaml.cpp @@ -323,7 +323,7 @@ public: if(_test.server) { printLineToConsoleOutput("*** running test " + _test.name); - runClientServerTest(_test.server, _test.client); + runClientServerTest(_test.server, _test.client); printLineToConsoleOutput(""); } else @@ -454,7 +454,7 @@ MainPage::MainPage() void MainPage::OnNavigatedTo(NavigationEventArgs^ e) { - (void) e; // Unused parameter + (void) e; // Unused parameter } @@ -515,5 +515,5 @@ MainPage::runSelectedTest() TestRunnerPtr t = new TestRunner(allTest[TestList->SelectedIndex], config); t->start(); - t->getThreadControl().detach(); + t->getThreadControl().detach(); } diff --git a/cpp/test/WinRT/TestSuite/MainPage.xaml.h b/cpp/test/WinRT/TestSuite/MainPage.xaml.h index a49f4b546bc..096f8583fcc 100644 --- a/cpp/test/WinRT/TestSuite/MainPage.xaml.h +++ b/cpp/test/WinRT/TestSuite/MainPage.xaml.h @@ -28,7 +28,7 @@ public: void failed(Platform::String^ reason); protected: - + virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override; private: |