예제 #1
0
파일: file_test.cpp 프로젝트: TRI0N/wwiv
TEST(FileTest, Exists_Static) {
    FileHelper file;
    string tmp = file.TempDir();
    GTEST_ASSERT_NE("", tmp);
    ASSERT_TRUE(file.Mkdir("newdir"));
    File dne(tmp, "newdir");
    ASSERT_TRUE(File::Exists(dne.full_pathname())) << dne.full_pathname();
}
예제 #2
0
파일: file_test.cpp 프로젝트: TRI0N/wwiv
TEST(FileTest, Exists) {
    FileHelper file;
    string tmp = file.TempDir();
    GTEST_ASSERT_NE("", tmp);
    ASSERT_TRUE(file.Mkdir("newdir"));
    File f(tmp, "newdir");
    ASSERT_TRUE(f.Exists()) << f.full_pathname();
}
예제 #3
0
파일: file_test.cpp 프로젝트: TRI0N/wwiv
TEST(FileTest, Exists_TrailingSlash) {
    FileHelper file;
    string tmp = file.TempDir();
    GTEST_ASSERT_NE("", tmp);
    ASSERT_TRUE(file.Mkdir("newdir"));
    File dne(tmp, "newdir");
    string path = StringPrintf("%s%c", dne.full_pathname().c_str(), File::pathSeparatorChar);
    ASSERT_TRUE(File::Exists(path)) << path;
}
예제 #4
0
TEST(PPPConfigTest, NodeConfig) {
  FileHelper files;
  files.Mkdir("network");
  const string line("@2 [email protected]");
  files.CreateTempFile("network/address.net", line);
  const string network_dir = files.DirName("network");
  PPPConfig config(1, "mybbs", network_dir);
  const PPPNodeConfig* node_config = config.node_config_for(2);
  ASSERT_TRUE(node_config != nullptr);
  EXPECT_EQ("*****@*****.**", node_config->email_address);
}
예제 #5
0
TEST_F(CalloutTest, NodeConfig) {
  FileHelper files;
  files.Mkdir("network");
  const string line("@1 & \"foo\"");
  files.CreateTempFile("network/callout.net", line);
  const string network_dir = files.DirName("network");
  Callout callout(network_dir);
  const net_call_out_rec* con = callout.node_config_for(1);
  ASSERT_TRUE(con != nullptr);
  EXPECT_EQ(options_sendback, con->options);
  EXPECT_STREQ("foo", con->password);
}