-
Notifications
You must be signed in to change notification settings - Fork 0
/
polindrome.cc
30 lines (25 loc) · 911 Bytes
/
polindrome.cc
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
#include <gtest/gtest.h>
#include "polindrome.h"
TEST(HelloTest, BasicAssertions) {
// Polindrome
printf("isPalindrome:\n");
printf("Input: x = 121\n");
bool isPalindromeRes1 = isPalindrome(121);
printf("Output: %s\n", isPalindromeRes1 ? "true" : "false");
printf("Expected: true\n");
printf("isPalindrome:\n");
printf("Input: x = -121\n");
bool isPalindromeRes2 = isPalindrome(-121);
printf("Output: %s\n", isPalindromeRes2 ? "true" : "false");
printf("Expected: false\n");
printf("isPalindrome:\n");
printf("Input: x = 10\n");
bool isPalindromeRes3 = isPalindrome(10);
printf("Output: %s\n", isPalindromeRes3 ? "true" : "false");
printf("Expected: false\n");
printf("isPalindrome:\n");
printf("Input: x = 1000021\n");
bool isPalindromeRes4 = isPalindrome(1000021);
printf("Output: %s\n", isPalindromeRes4 ? "true" : "false");
printf("Expected: false\n");
}