SVN / public / code / vorlesung-02 / BirthdayParadoxTest.cpp

Revision 11340
Date
Committerhb1003
Download
// Copyright 2016, University of Freiburg,
// Chair of Algorithms and Data Structures.
// Author: Hannah Bast <bast@cs.uni-freiburg.de>.

// Include functions from the Google test framework.
#include <gtest/gtest.h>

// Include declarations from header files.
#include "./BirthdayParadox.h"

// #include "./BirthdayParadox.cpp"
// Declare the function (it is implemented elsewhere).
// int probabilitySameBirthday(int n);

TEST(BirthdayParadox, probabilitySameBirthday) {
  ASSERT_FLOAT_EQ(1/365.0, probabilitySameBirthday(2));
}

int main(int argc, char** argv) {
  ::testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}