X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FSocket%2FProtocols%2FRaw%2FMmapedPacketSocketHandle.test.cc;fp=senf%2FSocket%2FProtocols%2FRaw%2FMmapedPacketSocketHandle.test.cc;h=df29d21a1d5af290ed7c69c593db2da9bf0fa2d5;hb=72cc548dfc3fa72d14d4d8c1a178f162165e933a;hp=0000000000000000000000000000000000000000;hpb=c40594da2a8fc3d681ed3c2e74ff632f1df2b31c;p=senf.git diff --git a/senf/Socket/Protocols/Raw/MmapedPacketSocketHandle.test.cc b/senf/Socket/Protocols/Raw/MmapedPacketSocketHandle.test.cc new file mode 100644 index 0000000..df29d21 --- /dev/null +++ b/senf/Socket/Protocols/Raw/MmapedPacketSocketHandle.test.cc @@ -0,0 +1,69 @@ +// $Id$ +// +// Copyright (C) 2011 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// +// The contents of this file are subject to the Fraunhofer FOKUS Public License +// Version 1.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://senf.berlios.de/license.html +// +// The Fraunhofer FOKUS Public License Version 1.0 is based on, +// but modifies the Mozilla Public License Version 1.1. +// See the full license text for the amendments. +// +// Software distributed under the License is distributed on an "AS IS" basis, +// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +// for the specific language governing rights and limitations under the License. +// +// The Original Code is Fraunhofer FOKUS code. +// +// The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V. +// (registered association), Hansastraße 27 c, 80686 Munich, Germany. +// All Rights Reserved. +// +// Contributor(s): +// Thorsten Horstmann + +/** \file + \brief MmapedPacketSocketHandle unit tests */ + + +// Custom includes +#include "MmapedPacketSocketHandle.hh" + +#include +#include + +#define prefix_ +//-///////////////////////////////////////////////////////////////////////////////////////////////// + +SENF_AUTO_UNIT_TEST(mmapedPacketSocketHandle) +{ + // packet sockets are only allowed for root + if (getuid() != 0) { + BOOST_WARN_MESSAGE(false, "Cannot test senf::MmapedPacketSocketHandle as non-root user"); + BOOST_CHECK( true ); + return; + } + + { + senf::MmapedPacketSocketHandle sock; + + BOOST_CHECK( ! sock.eof() ); + } +} + +//-///////////////////////////////////////////////////////////////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 +// End: