/ Check-in [4eb5b24c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a test case in zipfile.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | zipfile-timestamp-fix
Files: files | file ages | folders
SHA3-256:4eb5b24c64ee5907c18371f563b79fa0caf58285a62b8f09e639a690e6727eaa
User & Date: dan 2018-01-31 19:45:58
Context
2018-01-31
20:18
When creating a new archive entry, have zipfile store UTC instead of local time in the legacy MS-DOS format timestamp field. check-in: b730d187 user: dan tags: trunk
19:45
Fix a test case in zipfile.test. Closed-Leaf check-in: 4eb5b24c user: dan tags: zipfile-timestamp-fix
19:13
When creating a new archive entry, have zipfile store UTC instead of local time in the legacy MS-DOS format timestamp field. check-in: e2114df1 user: dan tags: zipfile-timestamp-fix
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/zipfile.test.

   390    390       ( SELECT rt( zipfile(name,NULL,mtime,data) ) FROM c )
   391    391     )
   392    392   } {
   393    393     a.txt 946684800 abc
   394    394   }
   395    395   
   396    396   if {[info vars ::UNZIP]!=""} { 
          397  +ifcapable datetime {
   397    398     load_static_extension db fileio
   398         -  forcedelete test.zip
          399  +  forcedelete test1.zip test2.zip
   399    400     do_test 6.0 {
   400    401       execsql {
   401    402         WITH c(name,mtime,data) AS (
   402    403           SELECT 'a.txt', 946684800, 'abc' UNION ALL
   403    404           SELECT 'b.txt', 1000000000, 'abc' UNION ALL
   404    405           SELECT 'c.txt', 1111111000, 'abc'
   405    406         )
   406         -      SELECT writefile('test.zip',
   407         -          ( SELECT rt ( zipfile(name,NULL,mtime,data) ) FROM c )
   408         -      );
          407  +      SELECT writefile('test1.zip', rt( zipfile(name, NULL, mtime, data) ) ),
          408  +             writefile('test2.zip',   ( zipfile(name, NULL, mtime, data) ) ) 
          409  +      FROM c;
          410  +    }
          411  +    forcedelete test_unzip
          412  +    file mkdir test_unzip
          413  +    exec unzip -d test_unzip test1.zip
          414  +
          415  +    db eval {
          416  +      SELECT name, strftime('%s', mtime, 'unixepoch', 'localtime') 
          417  +      FROM fsdir('test_unzip') WHERE name!='test_unzip'
          418  +      ORDER BY name
   409    419       }
          420  +  } [list {*}{
          421  +    test_unzip/a.txt 946684800
          422  +    test_unzip/b.txt 1000000000 
          423  +    test_unzip/c.txt 1111111000 
          424  +  }]
          425  +
          426  +  do_test 6.1 {
   410    427       forcedelete test_unzip
   411    428       file mkdir test_unzip
   412         -    exec unzip -d test_unzip test.zip
          429  +    exec unzip -d test_unzip test2.zip
   413    430   
   414    431       db eval {
   415         -      SELECT name, mtime FROM fsdir('test_unzip') WHERE name!='test_unzip'
          432  +      SELECT name, mtime 
          433  +      FROM fsdir('test_unzip') WHERE name!='test_unzip'
   416    434         ORDER BY name
   417    435       }
   418    436     } [list {*}{
   419    437       test_unzip/a.txt 946684800
   420    438       test_unzip/b.txt 1000000000 
   421    439       test_unzip/c.txt 1111111000 
   422    440     }]
          441  +}
   423    442   }
   424    443   
   425    444   
   426    445   finish_test
   427    446