OSDN Git Service

Initial release for public VER0.1.3
authorHajime Kurita <www@dev.minakoe.jp>
Sat, 4 Sep 2010 23:16:14 +0000 (19:16 -0400)
committerHajime Kurita <www@dev.minakoe.jp>
Sat, 4 Sep 2010 23:16:14 +0000 (19:16 -0400)
1stclass.hpp
Changes
host2ip.c
t/test.cpp

index 9967ebd..6645ff5 100755 (executable)
@@ -7,6 +7,7 @@
 */
 #ifndef INCLUDED_1stclass
 #define INCLUDED_1stclass
+#include<string>
 using namespace std;
 
 class firstclass {
diff --git a/Changes b/Changes
index 04bff5b..7eddcde 100755 (executable)
--- a/Changes
+++ b/Changes
@@ -1,2 +1,2 @@
-0.1.2 05/Sep/2010 07:30:00\r
+0.1.3 05/Sep/2010 08:00:00\r
 Initial release for public\r
index cdedeff..ca3982b 100755 (executable)
--- a/host2ip.c
+++ b/host2ip.c
 
 #ifdef __cplusplus
 #include "1stclass.hpp"
+#include<string>
 string firstclass::host2ip(const string server_str){
   char ip[32]="";
   char *server=NULL;
   try{
-  server=new char[sizeof(char)*(server.length()+1)];
+  server=new char[sizeof(char)*(server_str.length()+1)];
   server[0]='\0';
   safe_strcat(server, server_str.c_str());
 #else
index 94c900d..742e015 100755 (executable)
@@ -7,6 +7,7 @@
 */
 #include <string>
 #include <string.h>
+#include <iostream>
 #include <sys/stat.h>
 #include "../1stclass.hpp"
 #include "../1stclass.h"
@@ -259,6 +260,29 @@ void tester::test(){
     cout << "remove_not_file_char/C: bad" << endl;
     bad++;
   }
+
+// /dev/shm/上への一時ファイル生成
+  string file="/tmp/test.txt";
+  if(fst.shmf(file)=="/dev/shm/_tmp_test.txt"){
+    cout << "shmf/C++: ok" << endl;
+    ok++;
+  }
+  else{
+    cout << "shmf/C++: bad" << endl;
+    bad++;
+  }
+
+  char tfile[]="/tmp/test.txt";
+  char sfile[1024]="";
+  shmf(tfile, sfile);
+  if(strcmp(sfile, "/dev/shm/_tmp_test.txt")==0){
+    cout << "shmf/C: ok" << endl;
+    ok++;
+  }
+  else{
+    cout << "shmf/C: bad" << endl;
+    bad++;
+  }
 }
 
 void tester::report(){