2022-11-02 13:34:49 +00:00
|
|
|
#include "s0007_reverse_integer.hpp"
|
|
|
|
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
TEST(Problem7, Case1) {
|
|
|
|
int i = 123;
|
|
|
|
int o = 321;
|
2022-11-30 10:20:36 +00:00
|
|
|
S0007 solution;
|
2022-11-02 13:34:49 +00:00
|
|
|
EXPECT_EQ(solution.reverse(i), o);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(Problem7, Case2) {
|
|
|
|
int i = -123;
|
|
|
|
int o = -321;
|
2022-11-30 10:20:36 +00:00
|
|
|
S0007 solution;
|
2022-11-02 13:34:49 +00:00
|
|
|
EXPECT_EQ(solution.reverse(i), o);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(Problem7, Case3) {
|
|
|
|
int i = 120;
|
|
|
|
int o = 21;
|
2022-11-30 10:20:36 +00:00
|
|
|
S0007 solution;
|
2022-11-02 13:34:49 +00:00
|
|
|
EXPECT_EQ(solution.reverse(i), o);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(Problem7, Case4) {
|
|
|
|
int i = -2147483648;
|
|
|
|
int o = 0;
|
2022-11-30 10:20:36 +00:00
|
|
|
S0007 solution;
|
2022-11-02 13:34:49 +00:00
|
|
|
EXPECT_EQ(solution.reverse(i), o);
|
|
|
|
}
|