-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
- Loading branch information
1 parent
91962ba
commit dc3d464
Showing
13 changed files
with
162 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
rosidl_generator_tests/test/rosidl_generator_c/test_descriptions.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2015 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
#include "rosidl_runtime_c/string.h" | ||
#include "rosidl_runtime_c/type_description/type_source__struct.h" | ||
|
||
#include "rosidl_generator_tests/msg/detail/defaults__struct.h" | ||
|
||
int main(int argc, char ** argv) | ||
{ | ||
(void)argc; | ||
(void)argv; | ||
|
||
// Smoke test linkage for extern type description | ||
const rosidl_runtime_c__String * typename = | ||
&rosidl_generator_tests__msg__Defaults__TYPE_DESCRIPTION.type_description.type_name; | ||
// fprintf(stderr, "%s\n", typename->data); | ||
const char * expected_name = "rosidl_generator_tests/msg/Defaults"; | ||
if (0 != memcmp(typename->data, expected_name, typename->size)) { | ||
fprintf(stderr, "Defaults typename incorrect.\n"); | ||
return 1; | ||
} | ||
|
||
// Smoke test linkage for extern type sources | ||
const size_t expected_num_sources = 0; // For now - this will fail when sources get added | ||
const rosidl_runtime_c__type_description__TypeSource__Sequence * sources = | ||
&rosidl_generator_tests__msg__Defaults__RAW_SOURCES; | ||
if (sources->size != expected_num_sources) { | ||
fprintf(stderr, "Defaults didn't have expected number of sources.\n"); | ||
return 1; | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.