#include <gtest/gtest.h>

extern "C" {
	#include "serialize.h"
}

static PaDriverCommand_t g_command;

class PaTzEncoderDriverCommandTest : public ::testing::Test {
protected:
  virtual void SetUp() {
  }

  virtual void TearDown() {
  }
};


TEST_F(PaTzEncoderDriverCommandTest, BufferNull) {
  int result;
  uint32_t *buffer_null = NULL;
  uint32_t buffer_size = 0;

  result = PaTzEncoderDriverCommand(&g_command, buffer_null, &buffer_size);

  EXPECT_EQ(PA_TZ_GENERAL_ERROR, result) <<
      "Encoding SHOULD fail if output buffer is NULL";
}

TEST_F(PaTzEncoderDriverCommandTest, BufferSizeNull) {
  int result;
  uint32_t buffer[1];

  result = PaTzEncoderDriverCommand(&g_command, &buffer[0], NULL);

  EXPECT_EQ(PA_TZ_GENERAL_ERROR, result) <<
      "Encoding SHOULD fail if output buffer is NULL";
}
