SQLite

Check-in [4eb5b24c64]
Login

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

Overview
Comment:Fix a test case in zipfile.test.
Downloads: Tarball | ZIP 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.864
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: b730d187f2 user: dan tags: trunk)
19:45
Fix a test case in zipfile.test. (Closed-Leaf check-in: 4eb5b24c64 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: e2114df183 user: dan tags: zipfile-timestamp-fix)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/zipfile.test.
390
391
392
393
394
395
396

397
398
399
400
401
402
403
404
405
406
407





408




409







410
411
412
413
414

415
416
417
418
419
420
421
422

423
424
425
426
427
    ( SELECT rt( zipfile(name,NULL,mtime,data) ) FROM c )
  )
} {
  a.txt 946684800 abc
}

if {[info vars ::UNZIP]!=""} { 

  load_static_extension db fileio
  forcedelete test.zip
  do_test 6.0 {
    execsql {
      WITH c(name,mtime,data) AS (
        SELECT 'a.txt', 946684800, 'abc' UNION ALL
        SELECT 'b.txt', 1000000000, 'abc' UNION ALL
        SELECT 'c.txt', 1111111000, 'abc'
      )
      SELECT writefile('test.zip',
          ( SELECT rt ( zipfile(name,NULL,mtime,data) ) FROM c )





      );




    }







    forcedelete test_unzip
    file mkdir test_unzip
    exec unzip -d test_unzip test.zip

    db eval {

      SELECT name, mtime FROM fsdir('test_unzip') WHERE name!='test_unzip'
      ORDER BY name
    }
  } [list {*}{
    test_unzip/a.txt 946684800
    test_unzip/b.txt 1000000000 
    test_unzip/c.txt 1111111000 
  }]

}


finish_test








>

|







|
|
>
>
>
>
>
|
>
>
>
>

>
>
>
>
>
>
>


|


>
|







>





390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
    ( SELECT rt( zipfile(name,NULL,mtime,data) ) FROM c )
  )
} {
  a.txt 946684800 abc
}

if {[info vars ::UNZIP]!=""} { 
ifcapable datetime {
  load_static_extension db fileio
  forcedelete test1.zip test2.zip
  do_test 6.0 {
    execsql {
      WITH c(name,mtime,data) AS (
        SELECT 'a.txt', 946684800, 'abc' UNION ALL
        SELECT 'b.txt', 1000000000, 'abc' UNION ALL
        SELECT 'c.txt', 1111111000, 'abc'
      )
      SELECT writefile('test1.zip', rt( zipfile(name, NULL, mtime, data) ) ),
             writefile('test2.zip',   ( zipfile(name, NULL, mtime, data) ) ) 
      FROM c;
    }
    forcedelete test_unzip
    file mkdir test_unzip
    exec unzip -d test_unzip test1.zip

    db eval {
      SELECT name, strftime('%s', mtime, 'unixepoch', 'localtime') 
      FROM fsdir('test_unzip') WHERE name!='test_unzip'
      ORDER BY name
    }
  } [list {*}{
    test_unzip/a.txt 946684800
    test_unzip/b.txt 1000000000 
    test_unzip/c.txt 1111111000 
  }]

  do_test 6.1 {
    forcedelete test_unzip
    file mkdir test_unzip
    exec unzip -d test_unzip test2.zip

    db eval {
      SELECT name, mtime 
      FROM fsdir('test_unzip') WHERE name!='test_unzip'
      ORDER BY name
    }
  } [list {*}{
    test_unzip/a.txt 946684800
    test_unzip/b.txt 1000000000 
    test_unzip/c.txt 1111111000 
  }]
}
}


finish_test