File: gtestCApiTest.h

package info (click to toggle)
zfp 1.0.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,744 kB
  • sloc: cpp: 20,656; ansic: 18,871; pascal: 1,231; f90: 907; python: 255; makefile: 183; sh: 79; fortran: 70
file content (31 lines) | stat: -rw-r--r-- 821 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "gtest/gtest.h"
#include "commonMacros.h"

class ZfpArrayConstructTest : public ::testing::Test {
protected:
  virtual void SetUp() {
    size_t num_64bit_entries = DIV_ROUND_UP(ZFP_HEADER_SIZE_BITS, CHAR_BIT * sizeof(uint64));
    buffer = new uint64[num_64bit_entries];

    bs = stream_open(buffer, num_64bit_entries * sizeof(uint64));
    stream = zfp_stream_open(bs);
    field = zfp_field_alloc();
  }

  virtual void TearDown() {
    zfp_field_free(field);
    zfp_stream_close(stream);
    stream_close(bs);
    delete[] buffer;
  }

  static uint64* buffer;
  static bitstream* bs;
  static zfp_stream* stream;
  static zfp_field* field;
};

uint64* ZfpArrayConstructTest::buffer;
bitstream* ZfpArrayConstructTest::bs;
zfp_stream* ZfpArrayConstructTest::stream;
zfp_field* ZfpArrayConstructTest::field;