#include
<stdio.h>
#include "LfsClient.h"
#include "Log.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
int tmain()
{
lfs::LfsClient lfs;
int ret = lfs.Initialize();
if(ret != 0)
{
LOG_ERROR("Initialize error!");
return -1;
}
int fd = lfs.Open("hello", O_CREAT|O_WRONLY);
if(fd < 0)
{
LOG_ERROR("Open failed");
return -1;
}
const char * msg = "hello world";
int64_t len = ::strlen(msg);
ret = lfs.Write(fd, msg, len);
if(ret < 0)
{
LOG_ERROR("write Failed [%d]", ret);
return -1;
}
lfs.Close(fd);
return 0;
}
#include <gtest/gtest.h>
int add(int a, int b)
{
return a + b;
}
TEST(FooTest, HandleNoneZeroInput)
{
EXPECT_EQ(14, add(4, 10));
EXPECT_EQ(12, add(30, 18));
}
int tmain(int argc, char* argv[])
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}