mirror of
https://github.com/ohwgiles/laminar.git
synced 2026-03-02 03:40:21 +00:00
fix minor compile warnings
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright 2019 Oliver Giles
|
||||
/// Copyright 2019-2020 Oliver Giles
|
||||
///
|
||||
/// This file is part of Laminar
|
||||
///
|
||||
@@ -19,15 +19,17 @@
|
||||
#ifndef LAMINAR_FIXTURE_H_
|
||||
#define LAMINAR_FIXTURE_H_
|
||||
|
||||
#include <capnp/rpc-twoparty.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include "laminar.capnp.h"
|
||||
#include "eventsource.h"
|
||||
#include "tempdir.h"
|
||||
#include "laminar.h"
|
||||
#include "log.h"
|
||||
#include "server.h"
|
||||
#include "conf.h"
|
||||
|
||||
#include <capnp/rpc-twoparty.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
class LaminarFixture : public ::testing::Test {
|
||||
public:
|
||||
LaminarFixture() {
|
||||
@@ -108,7 +110,7 @@ public:
|
||||
StringMap parseFromString(kj::StringPtr content) {
|
||||
char tmp[16] = "/tmp/lt.XXXXXX";
|
||||
int fd = mkstemp(tmp);
|
||||
write(fd, content.begin(), content.size());
|
||||
LSYSCALL(write(fd, content.begin(), content.size()));
|
||||
close(fd);
|
||||
StringMap map = parseConfFile(tmp);
|
||||
unlink(tmp);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright 2018 Oliver Giles
|
||||
/// Copyright 2018-2020 Oliver Giles
|
||||
///
|
||||
/// This file is part of Laminar
|
||||
///
|
||||
@@ -19,6 +19,8 @@
|
||||
#ifndef LAMINAR_TEMPDIR_H_
|
||||
#define LAMINAR_TEMPDIR_H_
|
||||
|
||||
#include "log.h"
|
||||
|
||||
#include <kj/filesystem.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -37,7 +39,7 @@ public:
|
||||
private:
|
||||
static kj::Path mkdtemp() {
|
||||
char dir[] = "/tmp/laminar-test-XXXXXX";
|
||||
::mkdtemp(dir);
|
||||
LASSERT(::mkdtemp(dir) != nullptr, "mkdtemp failed");
|
||||
return kj::Path::parse(&dir[1]);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright 2018 Oliver Giles
|
||||
/// Copyright 2018-2020 Oliver Giles
|
||||
///
|
||||
/// This file is part of Laminar
|
||||
///
|
||||
@@ -16,8 +16,9 @@
|
||||
/// You should have received a copy of the GNU General Public License
|
||||
/// along with Laminar. If not, see <http://www.gnu.org/licenses/>
|
||||
///
|
||||
#include <gtest/gtest.h>
|
||||
#include "conf.h"
|
||||
#include "log.h"
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
class ConfTest : public ::testing::Test {
|
||||
protected:
|
||||
@@ -30,7 +31,7 @@ protected:
|
||||
}
|
||||
void parseConf(std::string conf) {
|
||||
lseek(fd, SEEK_SET, 0);
|
||||
write(fd, conf.data(), conf.size());
|
||||
LSYSCALL(write(fd, conf.data(), conf.size()));
|
||||
cfg = parseConfFile(tmpFile);
|
||||
}
|
||||
StringMap cfg;
|
||||
|
||||
Reference in New Issue
Block a user