file src, file testv0.15
authorshura <[email protected]>
Fri, 26 Sep 2025 12:31:43 +0000 (26 15:31 +0300)
committershura <[email protected]>
Fri, 26 Sep 2025 12:31:43 +0000 (26 15:31 +0300)
Jamrules.configure
src/file_save.c
test/test_file.c
test/test_list.c

index 4c182a4..20f9f52 100644 (file)
@@ -196,6 +196,7 @@ rule -configure- {
     } else {
         -configure-add-line- "set-profile ;" ;
     }
+    -configure-add-line- "CFLAGS.all += -DPREFIX=\\\\\\\\\\\"$(PREFIX)\\\\\\\\\\\" ;" ;
     -configure-add-line- "BUILDDEBUG =" "$(BUILDDEBUG)" ";" ;
     -configure-add-line- "BUILDTESTS =" "$(BUILDTESTS)" ";" ;
     -configure-add-line- "MULTIARCH =" "$(MULTIARCH)" ";" ;
index 5ff9881..932aae0 100644 (file)
@@ -13,7 +13,9 @@ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
 #include "../include/libex/file.h"
 
 int save_file (const char *path, const char *buf, size_t buf_len) {
-    int fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH), rc = -1;
+    int fd = open(path, O_WRONLY | O_CREAT | O_TRUNC,
+                  S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH),
+        rc = -1;
     if (-1 != fd) {
         if (buf_len == write(fd, buf, buf_len))
             rc = 0;
index af534f6..6945ba9 100644 (file)
@@ -92,6 +92,9 @@ void test_path_combine () {
     path = path_add_path(path, "libex", NULL);
     printf("%s\n", path->ptr);
     free(path);
+    path = path_combine(PREFIX, "lib/xsqldb", NULL);
+    printf("%s\n", path->ptr);
+    free(path);
 }
 
 void test_path_split () {
@@ -188,8 +191,8 @@ int main (int argc, const char *argv[]) {
 /*    if (argc > 1)
         rmdirall(argv[1]);
     test_log();*/
-/*    test_path_combine();
-    test_conf();
+    test_path_combine();
+    /*test_conf();
     test_spec_path();
     test_expand_path();
     test_getdir();
@@ -199,7 +202,7 @@ int main (int argc, const char *argv[]) {
     test_copy_file(argc, argv);
     test_ls();
     test_load_all_file();
-    test_dirsplit();*/
-    test_makedir();
+    test_dirsplit();
+    test_makedir();*/
     return 0;
 }
index e9fdd4f..cd63050 100644 (file)
@@ -68,11 +68,11 @@ void test_01 (void) {
     clear_test_list(l);
 }
 
-void test_02_1_free (str_t **x) {
+/*void test_02_1_free (str_t **x) {
     free(*x);
 }
 
-str_list_t *test_02_1 (void) {
+/*str_list_t *test_02_1 (void) {
     str_list_t *list = create_str_list();
     str_t *s;
     list->on_free = test_02_1_free;
@@ -94,12 +94,12 @@ void test_02 (void) {
         } fn;
     }), NULL, 0);
     free_str_list(list);
-}
+}*/
 
 int main (int argc, const char *argv[]) {
 #ifndef __GNUC__
     libex_str_init();
 #endif
-    test_02();
+    test_01();
     return 0;
 }