1#!/usr/bin/perl
2##
3## Copyright 2019 The Android Open Source Project
4##
5## Licensed under the Apache License, Version 2.0 (the "License");
6## you may not use this file except in compliance with the License.
7## You may obtain a copy of the License at
8##
9##      http://www.apache.org/licenses/LICENSE-2.0
10##
11## Unless required by applicable law or agreed to in writing, software
12## distributed under the License is distributed on an "AS IS" BASIS,
13## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14## See the License for the specific language governing permissions and
15## limitations under the License.
16
17package Mockcify;
18
19use diagnostics;
20use strict;
21use warnings;
22
23use lib "$ENV{ANDROID_BUILD_TOP}/packages/modules/Bluetooth/system/test/tool";
24require 'mockcify_util.pl';
25
26printf("MOCKCIFY unit test\n");
27
28"void" eq comment_out_input_vars("void")
29    || die("FAIL file:",  __FILE__, " line:", __LINE__, "\n");
30"one /* two */" eq comment_out_input_vars("one two")
31    || die("FAIL file:",  __FILE__, " line:", __LINE__, "\n");
32"one /* two */, three /* four */, five /* six */" eq comment_out_input_vars("one two, three four, five six")
33    || die("FAIL file:",  __FILE__, " line:", __LINE__, "\n");
34"std::string /* s */, tSOME_STRUCT /* struct */" eq comment_out_input_vars("std::string   s  ,   tSOME_STRUCT  struct")
35    || die("FAIL file:",  __FILE__, " line:", __LINE__, "\n");
36"const std::string& /* s */, tSOME_STRUCT /* struct */" eq comment_out_input_vars("   const   std::string&   s  ,   tSOME_STRUCT  struct")
37    || die("FAIL file:",  __FILE__, " line:", __LINE__, "\n");
38
39printf("SUCCESS\n");
40