]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Clean up
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 7 Sep 2016 19:13:16 +0000 (21:13 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 7 Sep 2016 19:13:16 +0000 (21:13 +0200)
ccache.c
test.sh

index e60620493c90b1e87424796d8dde47c6b6cdd5da..8ffadccc164ea11929801b87cec9c110bda8014c 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -1740,8 +1740,8 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode)
                free(gcda_name);
        }
 
-       // Adding -arch to hash since cpp output is affected
-       for(size_t i = 0; i < arch_args_size; ++i) {
+       // Adding -arch to hash since cpp output is affected.
+       for (size_t i = 0; i < arch_args_size; ++i) {
                hash_delimiter(hash, "-arch");
                hash_string(hash, arch_args[i]);
        }
diff --git a/test.sh b/test.sh
index fe39a8220d3bd1065b90030943b429dddc8f3da7..6ca18c9bf036a4e14b8252e92f8cb2b7cb751fe9 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -1125,18 +1125,18 @@ SUITE_multi_arch_SETUP() {
 }
 
 SUITE_multi_arch() {
-# -------------------------------------------------------------------------
-    TEST "cache hit"
+    # -------------------------------------------------------------------------
+    TEST "cache hit, direct mode"
 
     # Different arches shouldn't affect each other
     $CCACHE_COMPILE -arch i386 -c test1.c
     expect_stat 'cache hit (direct)' 0
     expect_stat 'cache miss' 1
-    
+
     $CCACHE_COMPILE -arch x86_64 -c test1.c
     expect_stat 'cache hit (direct)' 0
     expect_stat 'cache miss' 2
-    
+
     $CCACHE_COMPILE -arch i386 -c test1.c
     expect_stat 'cache hit (direct)' 1
     expect_stat 'cache miss' 2
@@ -1145,23 +1145,24 @@ SUITE_multi_arch() {
     $CCACHE_COMPILE -arch i386 -arch x86_64 -c test1.c
     expect_stat 'cache hit (direct)' 1
     expect_stat 'cache miss' 3
-    
+
     $CCACHE_COMPILE -arch i386 -arch x86_64 -c test1.c
     expect_stat 'cache hit (direct)' 2
     expect_stat 'cache miss' 3
 
-    #The same for preprocessor mode
-    clear_cache
+    # -------------------------------------------------------------------------
+    TEST "cache hit, preprocessor mode"
+
     export CCACHE_NODIRECT=1
-    
+
     $CCACHE_COMPILE -arch i386 -c test1.c
     expect_stat 'cache hit (preprocessed)' 0
     expect_stat 'cache miss' 1
-    
+
     $CCACHE_COMPILE -arch x86_64 -c test1.c
     expect_stat 'cache hit (preprocessed)' 0
     expect_stat 'cache miss' 2
-    
+
     $CCACHE_COMPILE -arch i386 -c test1.c
     expect_stat 'cache hit (preprocessed)' 1
     expect_stat 'cache miss' 2
@@ -1170,11 +1171,10 @@ SUITE_multi_arch() {
     $CCACHE_COMPILE -arch i386 -arch x86_64 -c test1.c
     expect_stat 'cache hit (preprocessed)' 1
     expect_stat 'cache miss' 3
-    
+
     $CCACHE_COMPILE -arch i386 -arch x86_64 -c test1.c
     expect_stat 'cache hit (preprocessed)' 2
     expect_stat 'cache miss' 3
-
 }
 
 # =============================================================================
@@ -2445,7 +2445,7 @@ SUITE_readonly() {
         test_failed "Read-only mode + direct mode stored files in the cache"
     fi
 }
+
 # =============================================================================
 
 SUITE_readonly_direct_SETUP() {