1 // ===========================================================================
2 //
3 //                            PUBLIC DOMAIN NOTICE
4 //               National Center for Biotechnology Information
5 //
6 //  This software/database is a "United States Government Work" under the
7 //  terms of the United States Copyright Act.  It was written as part of
8 //  the author's official duties as a United States Government employee and
9 //  thus cannot be copyrighted.  This software/database is freely available
10 //  to the public for use. The National Library of Medicine and the U.S.
11 //  Government have not placed any restriction on its use or reproduction.
12 //
13 //  Although all reasonable efforts have been taken to ensure the accuracy
14 //  and reliability of the software and data, the NLM and the U.S.
15 //  Government do not and cannot warrant the performance or results that
16 //  may be obtained by using this software or data. The NLM and the U.S.
17 //  Government disclaim all warranties, express or implied, including
18 //  warranties of performance, merchantability or fitness for any particular
19 //  purpose.
20 //
21 //  Please cite the author in any work or product based on this material.
22 //
23 // ===========================================================================
24 
25 #include "VDB_Fixture.hpp"
26 
27 #include <ktst/unit_test.hpp> // TEST_CASE
28 #include <kfg/config.h>
29 
30 // #include <sysalloc.h>
31 // #include <cstdlib>
32 // #include <stdexcept>
33 
34 using namespace std;
35 
36 static rc_t argsHandler ( int argc, char * argv [] );
37 TEST_SUITE_WITH_ARGS_HANDLER ( VdbSlowTestSuite, argsHandler );
38 
FIXTURE_TEST_CASE(TestReadBitsDirect_vs_CellDataDirect,VDB_Fixture)39 FIXTURE_TEST_CASE(TestReadBitsDirect_vs_CellDataDirect, VDB_Fixture)
40 {   // VDB-4431
41     static char const *columns[] = { "(INSDC:4na:packed)READ", 0 };  //66795559 total
42     REQUIRE_RC ( Setup ( "JADQCU01", columns ) );
43 
44     uint32_t remaining_count_ReadBits;
45     {
46         const uint32_t elem_bits = 4;
47         uint32_t read_count;
48         char buffer[ 1 ];
49         REQUIRE_RC (  VCursorReadBitsDirect( curs, 2, col_idx[0],
50                                                 elem_bits, 0, buffer, 0, 0,
51                                                 &read_count, &remaining_count_ReadBits) );
52     }
53 
54     uint32_t remaining_count_CellData;
55     {
56         uint32_t elem_bits;
57         const void * buffer;
58         uint32_t boff;
59         REQUIRE_RC ( VCursorCellDataDirect ( curs, 2, col_idx[0], &elem_bits, &buffer, &boff, &remaining_count_CellData ) );
60     }
61 
62     REQUIRE_EQ( remaining_count_ReadBits, remaining_count_CellData );
63 }
64 //////////////////////////////////////////// Main
65 #include <kapp/args.h>
66 
argsHandler(int argc,char * argv[])67 static rc_t argsHandler ( int argc, char * argv [] ) {
68     Args * args = NULL;
69     rc_t rc = ArgsMakeAndHandle ( & args, argc, argv, 0, NULL, 0 );
70     ArgsWhack ( args );
71     return rc;
72 }
73 
74 extern "C"
75 {
76 
KAppVersion(void)77 ver_t CC KAppVersion ( void )
78 {
79     return 0x1000000;
80 }
UsageSummary(const char * progname)81 rc_t CC UsageSummary (const char * progname)
82 {
83     return 0;
84 }
85 
Usage(const Args * args)86 rc_t CC Usage ( const Args * args )
87 {
88     return 0;
89 }
90 
91 const char UsageDefaultName[] = "test-vdb";
92 
KMain(int argc,char * argv[])93 rc_t CC KMain ( int argc, char *argv [] )
94 {
95     KConfigDisableUserSettings();
96     rc_t rc=VdbSlowTestSuite(argc, argv);
97     return rc;
98 }
99 
100 }
101