Mercurial > hg > th-libs
comparison tests.c @ 745:0c90dd46c49f
Only do certain th_file tests if we are compiled for *NIX (Win/DOS specific
tests tbd later, if ever.)
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 21 Dec 2022 13:17:20 +0200 |
parents | e2873f764b63 |
children | 3f59c5ab7fea |
comparison
equal
deleted
inserted
replaced
744:4181d43f91f9 | 745:0c90dd46c49f |
---|---|
808 TEST1A("%s", cfg, !=, NULL); | 808 TEST1A("%s", cfg, !=, NULL); |
809 | 809 |
810 TEST1(th_stat_path(home, &stat) == true); | 810 TEST1(th_stat_path(home, &stat) == true); |
811 TEST1A("%d", (stat.flags & TH_IS_DIR), !=, 0); | 811 TEST1A("%d", (stat.flags & TH_IS_DIR), !=, 0); |
812 | 812 |
813 #ifdef TH_PLAT_UNIX | |
813 TEST1(th_stat_path("/nonexist", &stat) == false); | 814 TEST1(th_stat_path("/nonexist", &stat) == false); |
814 TEST1(th_stat_path("/root", &stat) == true); | 815 TEST1(th_stat_path("/root", &stat) == true); |
815 TEST1A("%d", (stat.flags & TH_IS_WRITABLE), ==, 0); | 816 TEST1A("%d", (stat.flags & TH_IS_WRITABLE), ==, 0); |
816 | 817 |
817 TEST1((res = th_mkdir_path("/tmp/thlibtest/foobar/baz", 0)) == THERR_OK); | 818 TEST1((res = th_mkdir_path("/tmp/thlibtest/foobar/baz", 0)) == THERR_OK); |
819 if (res == THERR_OK) | 820 if (res == THERR_OK) |
820 { | 821 { |
821 TEST1(th_stat_path("/tmp/thlibtest/foobar/baz", &stat) == true); | 822 TEST1(th_stat_path("/tmp/thlibtest/foobar/baz", &stat) == true); |
822 TEST1A("%d", (stat.flags & TH_IS_DIR), !=, 0); | 823 TEST1A("%d", (stat.flags & TH_IS_DIR), !=, 0); |
823 } | 824 } |
825 #endif | |
824 } | 826 } |
825 | 827 |
826 // | 828 // |
827 // Test series for printf() | 829 // Test series for printf() |
828 // | 830 // |