Repository: mesos Updated Branches: refs/heads/master 9c8eee35d -> 8a03476eb
Removed unused libprocess test tools. Review: https://reviews.apache.org/r/67431/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8a03476e Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8a03476e Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8a03476e Branch: refs/heads/master Commit: 8a03476eb371b63a39e26392f670b3a64be886ca Parents: 9c8eee3 Author: Benjamin Bannier <[email protected]> Authored: Mon Jun 4 10:42:51 2018 +0200 Committer: Benjamin Bannier <[email protected]> Committed: Mon Jun 4 10:42:51 2018 +0200 ---------------------------------------------------------------------- 3rdparty/libprocess/src/test-master.cpp | 72 --------------------------- 3rdparty/libprocess/src/test-slave.cpp | 73 ---------------------------- 2 files changed, 145 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/8a03476e/3rdparty/libprocess/src/test-master.cpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/src/test-master.cpp b/3rdparty/libprocess/src/test-master.cpp deleted file mode 100644 index 5026af3..0000000 --- a/3rdparty/libprocess/src/test-master.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License - -#include <io.hpp> -#include <tuple.hpp> - -#include <string> - -#include "test.hpp" - -namespace tuple = process::tuple; - -using std::string; - -class Master : public Tuple<Process> -{ -private: - int id; - -protected: - void operator()() - { - do { - switch (receive()) { - case REGISTER: { - Out::println("Master received REGISTER"); - - string name; - unpack<REGISTER>(name); - - Out::println("Registered agent: %s", name.c_str()); - - send(from(), pack<OKAY>(id++)); - break; - } - case UNREGISTER: { - Out::println("Master received UNREGISTER"); - - int slave_id; - unpack<UNREGISTER>(slave_id); - - Out::println("Unregistered agent id: %d", slave_id); - - send(from(), pack<OKAY>(0)); - break; - } - default: - Out::println("UNKNOWN MESSAGE RECEIVED"); - } - } while (true); - } - -public: - Master() : id(0) {} -}; - - -int main(int argc, char **argv) -{ - PID master = Process::spawn(new Master()); - Out::println("master: %s", string(master).c_str()); - Process::wait(master); -} http://git-wip-us.apache.org/repos/asf/mesos/blob/8a03476e/3rdparty/libprocess/src/test-slave.cpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/src/test-slave.cpp b/3rdparty/libprocess/src/test-slave.cpp deleted file mode 100644 index 4516bdc..0000000 --- a/3rdparty/libprocess/src/test-slave.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License - -#include <test.hpp> - -namespace record = process::record; - -class Slave : public RecordProcess -{ -private: - PID master; - int id; - -protected: - void operator()() - { - send(master, pack<REGISTER>("c3po")); - - switch (receive()) { - case OKAY: { - std::cout << "agent registered" << std::endl; - unpack<OKAY>(id); - std::cout << "agent id: " << id << std::endl; - break; - } - default: - std::cout << "agent failed to register" << std::endl; - break; - } - - send(master, pack<UNREGISTER>(id)); - - switch (receive()) { - case OKAY: - std::cout << "agent unregistered" << std::endl; - break; - default: - std::cout << "agent failed to unregister" << std::endl; - break; - } - - link(master); - switch (receive()) { - case PROCESS_EXIT: - std::cout << "master exited" << std::endl; - break; - default: - std::cout << "unexpected message" << std::endl; - break; - } - } - -public: - explicit Slave(const PID &_master) : master(_master) {} -}; - - -int main(int argc, char **argv) -{ - PID master = make_pid(argv[1]); - PID slave = Process::spawn(new Slave(master)); - std::cout << "agent is at " << slave << std::endl; - Process::wait(slave); -}
