24 lines
539 B
C++
24 lines
539 B
C++
|
#include "s0454_4sum.hpp"
|
||
|
|
||
|
#include <gtest/gtest.h>
|
||
|
|
||
|
TEST(Problem454, Case1) {
|
||
|
vector<int> nums1{1, 2};
|
||
|
vector<int> nums2{-2, -1};
|
||
|
vector<int> nums3{-1, 2};
|
||
|
vector<int> nums4{0, 2};
|
||
|
int expected{2};
|
||
|
S0454 solution;
|
||
|
EXPECT_EQ(solution.fourSumCount(nums1, nums2, nums3, nums4), expected);
|
||
|
}
|
||
|
|
||
|
TEST(Problem454, Case2) {
|
||
|
vector<int> nums1{0};
|
||
|
vector<int> nums2{0};
|
||
|
vector<int> nums3{0};
|
||
|
vector<int> nums4{0};
|
||
|
int expected{1};
|
||
|
S0454 solution;
|
||
|
EXPECT_EQ(solution.fourSumCount(nums1, nums2, nums3, nums4), expected);
|
||
|
}
|